Custom Post Type UI Plugin- How to add categories and tags??

eCommerce WordPress theme with various e-store features and WooCommerce support.
GK User
Tue Aug 20, 2013 2:53 am
Installed Custom Post Type UI plugin. Created a custom post called "Conditions". Now I need to include categories and tags on the right side-bar of the edit/add new pages of the control panel (just like on the regular post page). I tried adding the following code into the functions.php file but no luck. The first bit of code gave me an error and the second did nothing. The "register_post_type()" function is kept in the plugins folder in portfolio-post-type.php. Any ideas on what code to use and where to put it?? I really need categories in these posts. Thanks.

add_action('init','add_categories_to_cpt');
function add_categories_to_cpt(){
register_taxonomy_for_object_type('category', 'conditions');
}

and

add_action('plugins_loaded','add_categories_to_cpt');
function add_categories_to_cpt(){
register_taxonomy_for_object_type('category', 'conditions');
}


I also tried:

register_taxonomy_for_object_type('post_tag', 'conditions');
register_taxonomy_for_object_type(‘category’, ‘conditions’);

but no go.
User avatar
Gold Boarder

GK User
Tue Aug 20, 2013 7:22 am
Hi,

Actions, hooks, filters etc. you can write in StoreBox/gavern/user.functions.php file, but i have no idea what code you should put there, check your plugin documentation.
User avatar
Moderator


cron