Hooking a custom taxonomy to a post type


show more Hooking a custom taxonomy to a 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 ...

Hooking a custom taxonomy to a post type

With the custom taxonomy created, it's time to attach it to some post types. What's cool here is that you can attach the same taxonomy to multiple different post types so that a visitor can get results from several different post types when navigating based on the taxonomy items. Actually hooking a taxonomy to a post type is very easy and I'll show you how. If we look at our current function, the registered_taxonomy function, it says meal-type and then it says array and it has the entire array of all the variables.

If we now simply go in right before the array and add a post type name, so I will call recipes and then add a comma and save this, we can now go to the browser, reload it, and you will see that under Recipes we now have the taxonomy Meal type. You can go in and administer Meal type taxonomy just likely would otherwise, and you can go in and Add new recipe, and you will see Meal type appears on the side where you would normally see a category. But if we go to Photos...

Hooking a custom taxonomy to a post type
Video duration: 3m 13s 3h 13m Advanced

Viewers:

Hooking a custom taxonomy to a 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 ...