Adding advanced variables to the custom post type


show more Adding advanced variables to the custom post type provides you with in-depth training on Design. Taught by Morten Rand-Hendriksen as part of the Create an Online Portfolio with WordPress show less
please wait ...

Adding advanced variables to the custom post type

In the previous movie, we created three basic custom post types. But as you saw, when we went to WordPress Admin, when creating a new post under them, the text displayed inside WordPress still calls all of them just Post. Though, this doesn't look like much right away. It's a bit sloppy and it can also lead to confusion. After all, when you click Add New under Recipes, why does it say create new post? Fortunately, we can fix out this with a few more lines of code in our function. Each of the custom post type definition functions can have a variable called labels.

This is where we put all the labels for a custom post type. This variable can take an array of labels. So we are going to create a new separate array and then call it from within the function itself. If you go to your code-snippets, you see here under 03_03, there's an example of a new array for recipes. It starts with recipe_labels and then it goes down to this end bracket. So, if you copy this, go into your posttype...

Adding advanced variables to the custom post type
Video duration: 3m 35s 3h 13m Advanced

Viewers:

Adding advanced variables to the custom post type provides you with in-depth training on Design. Taught by Morten Rand-Hendriksen as part of the Create an Online Portfolio with WordPress

Subjects:
Design Web
Software:
WordPress
Author:
please wait ...