• When i create a custom post,All Category show hare.But i want to show only custom post category here is my code.

    [ Moderator note: Code fixed, please wrap code in backticks or use the code button. ]

    /*Add Custom Post*/
    add_action('init', 'register_mypost_type');
    function register_mypost_type() {
    register_post_type('people',
    		array(	'label' => 'Testimonials',
    				'public' => true,'show_ui' => true,
    				'show_in_menu' => true,
    				'capability_type' => 'post',
    				'hierarchical' => false,
    				'rewrite' => array('slug' => ''),
    				'query_var' => true,
    				'has_archive' => true,
    				'supports' => array('title','editor','thumbnail',),
    				'taxonomies' => array('category', 'post_tag'),
    				'menu_position' => 5,
    				) );
    }
    
    /*Add Custom Post*/
Viewing 1 replies (of 1 total)
  • Chad

    (@lynneandchad)

    Not sure if I understand your question – but all categories will be available under this custom post type because you’ve specified ‘category’ under ‘taxonomies’

    Perhaps you want to consider creating a custom taxonomy to along with this post type?

Viewing 1 replies (of 1 total)
  • The topic ‘Show only Testimonial's category’ is closed to new replies.