admin管理员组

文章数量:1323355

I have created the custom post type but it is showing the posts categories in my created custom post type category.

I don't want to show the posts categories in my created custom post type category.

Here is my code added in functions.php:

function create_posttype() {
    
    register_post_type( 'vm_news',
    array(
        'labels' => array(
            'name' => __( 'News' ),
            'singular_name' => __( 'News' ), //in the horizontal bar when you are logged in.
            'add_new' => __('Add news'),
            'add_new_item' => __('New news'),
            'edit_item' => __('Edit news'),
            'new_item' => __('New news'),
            'view_item' => __('Show all news'),
            'search_items' => __('Search news'),
            'not_found' =>  __('No news found'),
            'not_found_in_trash' => __('No news found in trash'), 
            'parent_item_colon' => '',
            'menu_name' => 'News'
        ),
    'public' => true,
    'has_archive' => false,
    'show_in_menu' => true, 
    'show_ui' => true,
    'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),
    'rewrite' => array(
            'slug'       => 'news',
            'with_front'            => false
        ),
    'taxonomies' => array('topics', 'category' )
    )
);
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );

Any help is much appreciated.

本文标签: Posts Categories Are Showing In The Custom Post Type Category