Add category selection to custom post type

Adding this wordpress snippet to the functions.php will enable category selection within the editor for your custom post type. Don’t forget to change the CUSTOM_POST_TYPE to the name of the custom post type you created.

 

 

function reg_cat() {
register_taxonomy_for_object_type('category','CUSTOM_POST_TYPE');
}
add_action('init', 'reg_cat');

Leave a comment