Cannot add category names to custom post types
-
Hello everyone
I managed to create a custom post type by editing functions.php but cannot add any category names to the custom post type by way of adding the following line in (as shown at https://www.wpbeginner.com/wp-tutorials/how-to-add-categories-to-a-custom-post-type-in-wordpress/):
'taxonomies' => array('topics', 'category' ),
I inserted the line above into the array in register_post_type with no luck:
register_post_type('news', array( 'labels' => array( 'name' => __('Investment'), 'public' => true, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail'), 'taxonomies' => array('topics', 'category' ), ) );
Did I insert the line into the wrong location or does it require more scripting? Either way, some advice would be appreciated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Cannot add category names to custom post types’ is closed to new replies.