Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have two kind of post types in my WordPress website:

  1. "Articles" which is the classic post type
  2. "Breves" which is a custom post type

I want them to share the same standard categories and post tags so this is how I created the "Breve" custom post type as a plugin:

function breve_register() {

    $labels = array(
        'name' => _x('Brèves', 'post type general name'),
        'singular_name' => _x('Brève', 'post type singular name'),
        'add_new' => _x('Ajouter', 'portfolio item'),
        'add_new_item' => __('Ajouter une brève'),
        'edit_item' => __('Editer une brève'),
        'new_item' => __('Nouvelle brève'),
        'view_item' => __('Voir la brève'),
        'search_items' => __('Rechercher une brève'),
        'not_found' =>  __('Aucune brève trouvée'),
        'not_found_in_trash' => __('Aucune brève trouvée dans la corbeille'),
        'parent_item_colon' => ''
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => true,
        'capability_type' => 'post',
        'hierarchical' => false,
        'menu_position' => null,
        'supports' => array('title','editor','thumbnail'),
        'taxonomies' => array('category', 'post_tag')
      ); 

    register_post_type( 'breve' , $args );
}
add_action('init', 'breve_register');

It works well as I can select a category and define a post tag when I create a new "breve" post, the same way I would with a new "article".

My concern:

Before registering the taxonomies of "Breves", only the "Articles" section displayed the "Categories" and "Post tags" links on the left admin menu bar. Now, these two links also appear under the "Breves" section of the left admin menu bar which is redundant.

At least, I would like to see the "Categories" and "Post Tags" links only for "Articles", not for "Breves" on the left admin menu bar.

But if possible (this would be awesome), I would like "Categories" and "Post Tags" to show only once and at the SAME LEVEL than "Articles" and 'Breves" on the Admin menu bar, not inside any of these two sections. It would make sense as now "Categories" and "Post Tags" are shared by more than one section so putting them under a single section would raise an ergonomic and logic issue.

May I ask you some help on how to achieve this?

Thank you.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The admin menu is kind of a pain to work with, it's not very flexible and is in need of an overhaul. See this ongoing ticket on the subject.

What you can do is use the remove_submenu_page function to remove the category and tag submenu pages, then add them on the top level via add_menu_page. For example, this will remove the categories submenu and move it to the top level:

function wpa83704_adjust_the_wp_menu() {
    remove_submenu_page(
        'edit.php',
        'edit-tags.php?taxonomy=category'
    );
    add_menu_page(
        'Categories',
        'Categories',
        'add_users',
        'edit-tags.php?taxonomy=category',
        '',
        'div',
        6
    );
}
add_action( 'admin_menu', 'wpa83704_adjust_the_wp_menu', 999 );

There are a couple of issues here though.

  1. The icons that WordPress uses for menu items can't readily be used for these new menu items, you need a URL to the image, or you can set it to div and you'll have to add some CSS via admin_head to get the icon you want in there.

  2. When you select the new Categories top-level menu item, the wrong menu item will be highlighted. The only way to fix this currently is via JavaScript. See this answer for some code to solve that.

share|improve this answer
    
This is almost it, thank you! I don't accept the answer yet as your script doesn't solve everything because: 1) the "Categories" link is still displayed under the "Breves" section of the admin menu bar and 2) I don't know how to adapt your script to also deal with the post tags. –  Baylock Jan 30 '13 at 11:08
    
Point 2 has been easily solved, point 1 is pending. –  Baylock Jan 30 '13 at 11:14
    
Nevermind, I had to set the remove_submenu_page to "edit-tags.php?taxonomy=post_tag&post_type=breve". Thank you! –  Baylock Jan 30 '13 at 13:16

why not try this plugin: Custom Post Type UI,It allows you to add any post type you want,and also it can sepetates taxonomies and categories for each post type

also below is what i wrote in a project before i fount the plugin,may it help you:

    <?php
    define('CUSTOM_POST_TYPE1','event');  //PLEASE DON'T CHANGE THIS CONTENT max. 20 characters, can not contain capital letters or spaces
    define('CUSTOM_CATEGORY_TYPE1','eventcategory');  //PLEASE DON'T CHANGE THIS CONTENT
    define('CUSTOM_TAG_TYPE1','eventtags');  //PLEASE DON'T CHANGE THIS CONTENT


    define('CUSTOM_POST_TYPE2','activity');  //PLEASE DON'T CHANGE THIS CONTENT max. 20 characters, can not contain capital letters or spaces
    define('CUSTOM_CATEGORY_TYPE2','activitycategory');  //PLEASE DON'T CHANGE THIS CONTENT
    define('CUSTOM_TAG_TYPE2','activitytags');  //PLEASE DON'T CHANGE THIS CONTENT


    define('CUSTOM_POST_TYPE3','product');  //PLEASE DON'T CHANGE THIS CONTENT max. 20 characters, can not contain capital letters or spaces
    define('CUSTOM_CATEGORY_TYPE3','productcategory');  //PLEASE DON'T CHANGE THIS CONTENT
    define('CUSTOM_TAG_TYPE3','producttags');  //PLEASE DON'T CHANGE THIS CONTENT






    //////////CUSTOM POST TYPE LABELS////////
    define('CUSTOM_TAXONOMY_SEARCH_ITEM',__('Search Category'));
    define('CUSTOM_POST_EDIT',__('Edit'));


    define('CUSTOM_POST_LABEL',__('Events'));
    define('CUSTOM_POST_LABEL2',__('Activity'));
    define('CUSTOM_POST_LABEL3',__('Product'));

    define('CUSTOM_POST_NAME',__('Events'));
    define('CUSTOM_POST_NAME2',__('Activity'));
    define('CUSTOM_POST_NAME3',__('Product'));

    define('CUSTOM_POST_SINGULAR_NAME',__('Event'));
    define('CUSTOM_POST_SINGULAR_NAME2',__('Activity'));
    define('CUSTOM_POST_SINGULAR_NAME3',__('Product'));

    define('CUSTOM_POST_ADD_NEW',__('Add Event'));
    define('CUSTOM_POST_ADD_NEW2',__('Add Activity'));
    define('CUSTOM_POST_ADD_NEW3',__('Add Product'));

    define('CUSTOM_POST_ADD_NEW_ITEM',__('Add New Event'));
    define('CUSTOM_POST_ADD_NEW_ITEM2',__('Add New Activity'));
    define('CUSTOM_POST_ADD_NEW_ITEM3',__('Add New Product'));


    define('CUSTOM_POST_EDIT_ITEM',__('Edit Event'));
    define('CUSTOM_POST_EDIT_ITEM2',__('Edit Activity'));
    define('CUSTOM_POST_EDIT_ITEM3',__('Edit Product'));

    define('CUSTOM_POST_NEW_ITEM',__('New Event'));
    define('CUSTOM_POST_NEW_ITEM2',__('New Activity'));
    define('CUSTOM_POST_NEW_ITEM3',__('New Product'));

    define('CUSTOM_POST_VIEW_ITEM',__('View Event'));
    define('CUSTOM_POST_VIEW_ITEM2',__('View Activity'));
    define('CUSTOM_POST_VIEW_ITEM3',__('View Product'));

    define('CUSTOM_POST_SEARCH_ITEM',__('Search Events'));
    define('CUSTOM_POST_SEARCH_ITEM2',__('Search Activity'));
    define('CUSTOM_POST_SEARCH_ITEM3',__('Search Product'));

    define('CUSTOM_POST_NOT_FOUND',__('No Events found'));
    define('CUSTOM_POST_NOT_FOUND2',__('No Activity found'));
    define('CUSTOM_POST_NOT_FOUND3',__('No Product found'));

    define('CUSTOM_POST_NOT_FOUND_IN_TRASH',__('No Events found in trash'));
    define('CUSTOM_POST_NOT_FOUND_IN_TRASH2',__('No Activity found in trash'));
    define('CUSTOM_POST_NOT_FOUND_IN_TRASH3',__('No Product found in trash'));

    define('CUSTOM_TAXONOMY_LABEL',__('Event Category'));
    define('CUSTOM_TAXONOMY_LABEL2',__('Activity Group'));
    define('CUSTOM_TAXONOMY_LABEL3',__('Activity Product'));

    define('CUSTOM_TAXONOMY_NAME',__('Event Categories'));
    define('CUSTOM_TAXONOMY_NAME2',__('Activity Groupes'));
    define('CUSTOM_TAXONOMY_NAME3',__('Product Categories'));

    define('CUSTOM_TAXONOMY_SINGULAR_NAME',__('Event Category'));
    define('CUSTOM_TAXONOMY_SINGULAR_NAME2',__('Activity Group'));
    define('CUSTOM_TAXONOMY_SINGULAR_NAME3',__('Product Category'));


    define('CUSTOM_TAXONOMY_POPULAR_ITEM',__('Popular Event Categories'));
    define('CUSTOM_TAXONOMY_POPULAR_ITEM2',__('Popular Activity Groups'));
    define('CUSTOM_TAXONOMY_POPULAR_ITEM3',__('Popular Product Categories'));

    define('CUSTOM_TAXONOMY_ALL_ITEMS',__('All Event Categories'));
    define('CUSTOM_TAXONOMY_ALL_ITEMS2',__('All Activity Groups'));
    define('CUSTOM_TAXONOMY_ALL_ITEMS3',__('All Product Categories'));

    define('CUSTOM_TAXONOMY_PARENT_ITEM',__('Parent Event Category'));
    define('CUSTOM_TAXONOMY_PARENT_ITEM2',__('Parent Activity Group'));
    define('CUSTOM_TAXONOMY_PARENT_ITEM3',__('Parent Product Category'));

    define('CUSTOM_TAXONOMY_PARENT_ITEM_COLON',__('Parent Event Category:'));
    define('CUSTOM_TAXONOMY_PARENT_ITEM_COLON2',__('Parent Activity Group:'));
    define('CUSTOM_TAXONOMY_PARENT_ITEM_COLON3',__('Parent Activity Category:'));

    define('CUSTOM_TAXONOMY_EDIT_ITEM',__('Edit Event Category'));
    define('CUSTOM_TAXONOMY_EDIT_ITEM2',__('Edit Activity Group'));
    define('CUSTOM_TAXONOMY_EDIT_ITEM3',__('Edit Product Category'));

    define('CUSTOM_TAXONOMY_UPDATE_ITEM',__('Update Event Category'));
    define('CUSTOM_TAXONOMY_UPDATE_ITEM2',__('Update Activity Group'));
    define('CUSTOM_TAXONOMY_UPDATE_ITEM3',__('Update Product Category'));

    define('CUSTOM_TAXONOMY_ADD_NEW_ITEM',__('Add New Event Category'));
    define('CUSTOM_TAXONOMY_ADD_NEW_ITEM2',__('Add New Activity Group'));
    define('CUSTOM_TAXONOMY_ADD_NEW_ITEM3',__('Add New Product Category'));

    define('CUSTOM_TAXONOMY_NEW_ITEM_NAME',__('New Event Category Name'));
    define('CUSTOM_TAXONOMY_NEW_ITEM_NAME2',__('New Activity Group Name'));
    define('CUSTOM_TAXONOMY_NEW_ITEM_NAME3',__('New Product Category Name'));

    define('CUSTOM_TAG_LABEL',__('Event Tags'));
    define('CUSTOM_TAG_LABEL2',__('Activity Tags'));
    define('CUSTOM_TAG_LABEL3',__('Product Tags'));

    define('CUSTOM_TAG_NAME',__('Event Tags'));
    define('CUSTOM_TAG_NAME2',__('Activity Tags'));
    define('CUSTOM_TAG_NAME3',__('Product Tags'));

    define('CUSTOM_TAG_SINGULAR_NAME',__('Event Tags'));
    define('CUSTOM_TAG_SINGULAR_NAME2',__('Activity Tags'));
    define('CUSTOM_TAG_SINGULAR_NAME3',__('Product Tags'));

    define('CUSTOM_TAG_SEARCH_ITEMS',__('Search Event Tags'));
    define('CUSTOM_TAG_SEARCH_ITEMS2',__('Search Activity Tags'));
    define('CUSTOM_TAG_SEARCH_ITEM3',__('Search Product Tags'));

    define('CUSTOM_TAG_POPULAR_ITEMS',__('Popular Event Tags'));
    define('CUSTOM_TAG_POPULAR_ITEMS2',__('Popular Activity Tags'));
    define('CUSTOM_TAG_POPULAR_ITEMS3',__('Popular Product Tags'));

    define('CUSTOM_TAG_ALL_ITEMS',__('All Event Tags'));
    define('CUSTOM_TAG_ALL_ITEMS2',__('All Activity Tags'));
    define('CUSTOM_TAG_ALL_ITEMS3',__('All Product Tags'));

    define('CUSTOM_TAG_PARENT_ITEM',__('Parent Event Tags'));
    define('CUSTOM_TAG_PARENT_ITEM2',__('Parent Activity Tags'));
    define('CUSTOM_TAG_PARENT_ITEM3',__('Parent Product Tags'));

    define('CUSTOM_TAG_PARENT_ITEM_COLON',__('Parent Event Tags:'));
    define('CUSTOM_TAG_PARENT_ITEM_COLON2',__('Parent Activity Tags:'));
    define('CUSTOM_TAG_PARENT_ITEM_COLON3',__('Parent Product Tags:'));

    define('CUSTOM_TAG_EDIT_ITEM',__('Edit Event Tags'));
    define('CUSTOM_TAG_EDIT_ITEM2',__('Edit Activity Tags'));
    define('CUSTOM_TAG_EDIT_ITEM3',__('Edit Product Tags'));

    define('CUSTOM_TAG_UPDATE_ITEM',__('Update Event Tags'));
    define('CUSTOM_TAG_UPDATE_ITEM2',__('Update Activity Tags'));
    define('CUSTOM_TAG_UPDATE_ITEM3',__('Update Product Tags'));

    define('CUSTOM_TAG_ADD_NEW_ITEM',__('Add New Event Tags'));
    define('CUSTOM_TAG_ADD_NEW_ITEM2',__('Add New Activity Tags'));
    define('CUSTOM_TAG_ADD_NEW_ITEM3',__('Add New Product Tags'));

    define('CUSTOM_TAG_NEW_ITEM_NAME',__('New Event Tags Name'));
    define('CUSTOM_TAG_NEW_ITEM_NAME2',__('New Activity Tags Name'));
    define('CUSTOM_TAG_NEW_ITEM_NAME3',__('New Product Tags Name'));


    define('CUSTOM_TAXONOMY_SEARCH_ITEM2',__('Search Groups'));

    ?>


    <?php
    add_action("init", "custom_posttype_menu_wp_admin");
    function custom_posttype_menu_wp_admin(){
    //===============EVENT SECTION START================
        register_post_type( CUSTOM_POST_TYPE1, 
                    array(  'label'             => CUSTOM_POST_LABEL,
                            'labels'            => array(   'name'                  => CUSTOM_POST_NAME,//
                                                            'singular_name'         => CUSTOM_POST_SINGULAR_NAME,
                                                            'add_new'               =>  CUSTOM_POST_ADD_NEW,
                                                            'add_new_item'          =>  CUSTOM_POST_ADD_NEW_ITEM,
                                                            'edit'                  =>  CUSTOM_POST_EDIT,
                                                            'edit_item'             =>  CUSTOM_POST_EDIT_ITEM,
                                                            'new_item'              =>  CUSTOM_POST_NEW_ITEM,
                                                            'view_item'             =>  CUSTOM_POST_VIEW_ITEM,
                                                            'search_items'          =>  CUSTOM_POST_SEARCH_ITEM,
                                                            'not_found'             =>  CUSTOM_POST_NOT_FOUND,
                                                            'not_found_in_trash'    =>  CUSTOM_POST_NOT_FOUND_IN_TRASH  ),
                            'public'            => true,
                            'can_export'        => true,
                            'show_ui'           => true, // UI in admin panel
                            '_builtin'          => false, // It's a custom post type, not built in
                            '_edit_link'        => 'post.php?post=%d',
                            'capability_type'   => 'post',
                            'menu_icon'         => get_bloginfo('template_url').'/images/favicon.ico',
                            'hierarchical'      => false,
                            'rewrite'           => array(   "slug" => CUSTOM_POST_TYPE1 ), // Permalinks
                            'query_var'         => CUSTOM_POST_TYPE1, // This goes to the WP_Query schema
                            'supports'          => array(   'title',
                                                            'author', 
                                                            'excerpt',
                                                            'thumbnail',
                                                            'comments',
                                                            'editor', 
                                                            'trackbacks',
                                                            'custom-fields',
                                                            'revisions') ,
                            'show_in_nav_menus' => true ,
                            'taxonomies'        => array(CUSTOM_CATEGORY_TYPE1,CUSTOM_TAG_TYPE1),
                            'menu_position' => 4
                        )
        );

    // Register custom taxonomy
        register_taxonomy(  CUSTOM_CATEGORY_TYPE1, 
                    array(  CUSTOM_POST_TYPE1   ), 
                    array ( "hierarchical"      => true, 
                            "label"             => CUSTOM_TAXONOMY_LABEL, 
                            'labels'            => array(   'name'              =>  CUSTOM_TAXONOMY_NAME,
                                                            'singular_name'     =>  CUSTOM_TAXONOMY_SINGULAR_NAME,
                                                            'search_items'      =>  CUSTOM_TAXONOMY_SEARCH_ITEM,
                                                            'popular_items'     =>  CUSTOM_TAXONOMY_POPULAR_ITEM,
                                                            'all_items'         =>  CUSTOM_TAXONOMY_ALL_ITEMS,
                                                            'parent_item'       =>  CUSTOM_TAXONOMY_PARENT_ITEM,
                                                            'parent_item_colon' =>  CUSTOM_TAXONOMY_PARENT_ITEM_COLON,
                                                            'edit_item'         =>  CUSTOM_TAXONOMY_EDIT_ITEM,
                                                            'update_item'       =>  CUSTOM_TAXONOMY_UPDATE_ITEM,
                                                            'add_new_item'      =>  CUSTOM_TAXONOMY_ADD_NEW_ITEM,
                                                            'new_item_name'     =>  CUSTOM_TAXONOMY_NEW_ITEM_NAME   ), 
                            'public'            => true,
                            'show_ui'           => true,
                            "rewrite"           => true )
        );


        register_taxonomy(CUSTOM_TAG_TYPE1, 
                    array(  CUSTOM_POST_TYPE1   ), 
                    array(  "hierarchical"      => false, 
                            "label"             => CUSTOM_TAG_LABEL, 
                            'labels'            => array(   'name'              => CUSTOM_TAG_NAME,
                                                            'singular_name'     => CUSTOM_TAG_SINGULAR_NAME,
                                                            'search_items'      => CUSTOM_TAG_SEARCH_ITEMS,
                                                            'popular_items'     => CUSTOM_TAG_POPULAR_ITEMS,
                                                            'all_items'         => CUSTOM_TAG_ALL_ITEMS,
                                                            'parent_item'       => CUSTOM_TAG_PARENT_ITEM,
                                                            'parent_item_colon' => CUSTOM_TAG_PARENT_ITEM_COLON,
                                                            'edit_item'         => CUSTOM_TAG_EDIT_ITEM,
                                                            'update_item'       => CUSTOM_TAG_UPDATE_ITEM,
                                                            'add_new_item'      => CUSTOM_TAG_ADD_NEW_ITEM,
                                                            'new_item_name'     => CUSTOM_TAG_NEW_ITEM_NAME ),  
                            'public'            => true,
                            'show_ui'           => true,
                            "rewrite"           => true )
    );
    //===============EVENT SECTION END================

    //===============ACTIVE SECTION START================
        register_post_type( CUSTOM_POST_TYPE2,
                    array(  'label'             => CUSTOM_POST_LABEL2,
                            'labels'            => array(   
                                        'name'                  =>  CUSTOM_POST_NAME2,//
                                        'singular_name'         =>  CUSTOM_POST_SINGULAR_NAME2,
                                        'add_new'               =>  CUSTOM_POST_ADD_NEW2,
                                        'add_new_item'          =>  CUSTOM_POST_ADD_NEW_ITEM2,
                                        'edit'                  =>  CUSTOM_POST_EDIT,
                                        'edit_item'             =>  CUSTOM_POST_EDIT_ITEM2,
                                        'new_item'              =>  CUSTOM_POST_NEW_ITEM2,
                                        'view_item'             =>  CUSTOM_POST_VIEW_ITEM2,
                                        'search_items'          =>  CUSTOM_POST_SEARCH_ITEM2,
                                        'not_found'             =>  CUSTOM_POST_NOT_FOUND2,
                                        'not_found_in_trash'    =>  CUSTOM_POST_NOT_FOUND_IN_TRASH2 
                            ),
                            'public'            => true,
                            'can_export'        => true,
                            'show_ui'           => true, // UI in admin panel
                            '_builtin'          => false, // It's a custom post type, not built in
                            '_edit_link'        => 'post.php?post=%d',
                            'capability_type'   => 'post',
                            'menu_icon'         => get_bloginfo('template_url').'/images/activity.ico',
                            'hierarchical'      => false,
                            'rewrite'           => array(   "slug" => CUSTOM_POST_TYPE2 ), // Permalinks
                            'query_var'         => CUSTOM_POST_TYPE2, // This goes to the WP_Query schema
                            'supports'          => array(   
                                                    'title',
                                                    'author',
                                                    'excerpt',
                                                    'thumbnail',
                                                    'comments',
                                                    'editor',
                                                    'trackbacks',
                                                    'custom-fields',
                                                    'revisions'
                            ) ,
                            'show_in_nav_menus' => true ,
                            'taxonomies'        => array(CUSTOM_CATEGORY_TYPE2,CUSTOM_TAG_TYPE2),
                            'menu_position' => 5
                    )
        );

    // Register custom taxonomy
    register_taxonomy(  CUSTOM_CATEGORY_TYPE2,
            array(  CUSTOM_POST_TYPE2   ),
            array ( 
                    "hierarchical"      => true,
                    "label"             => CUSTOM_TAXONOMY_LABEL2,
                    'labels'            => array(   
                                'name'              =>  CUSTOM_TAXONOMY_NAME2,
                                'singular_name'     =>  CUSTOM_TAXONOMY_SINGULAR_NAME2,
                                'search_items'      =>  CUSTOM_TAXONOMY_SEARCH_ITEM2,
                                'popular_items'     =>  CUSTOM_TAXONOMY_POPULAR_ITEM2,
                                'all_items'         =>  CUSTOM_TAXONOMY_ALL_ITEMS2,
                                'parent_item'       =>  CUSTOM_TAXONOMY_PARENT_ITEM2,
                                'parent_item_colon' =>  CUSTOM_TAXONOMY_PARENT_ITEM_COLON2,
                                'edit_item'         =>  CUSTOM_TAXONOMY_EDIT_ITEM2,
                                'update_item'       =>  CUSTOM_TAXONOMY_UPDATE_ITEM2,
                                'add_new_item'      =>  CUSTOM_TAXONOMY_ADD_NEW_ITEM2,
                                'new_item_name'     =>  CUSTOM_TAXONOMY_NEW_ITEM_NAME2  
                    ),
                    'public'            => true,
                    'show_ui'           => true,
                    "rewrite"           => true 
            )
    );


    register_taxonomy(CUSTOM_TAG_TYPE2,
                    array(  CUSTOM_POST_TYPE2   ),
                    array(
                        "hierarchical"      => false,
                        "label"             => CUSTOM_TAG_LABEL2,
                        'labels'            => array(   'name'              => CUSTOM_TAG_NAME2,
                        'singular_name'     => CUSTOM_TAG_SINGULAR_NAME2,
                        'search_items'      => CUSTOM_TAG_SEARCH_ITEMS2,
                        'popular_items'     => CUSTOM_TAG_POPULAR_ITEMS2,
                        'all_items'         => CUSTOM_TAG_ALL_ITEMS2,
                        'parent_item'       => CUSTOM_TAG_PARENT_ITEM2,
                        'parent_item_colon' => CUSTOM_TAG_PARENT_ITEM_COLON2,
                        'edit_item'         => CUSTOM_TAG_EDIT_ITEM2,
                        'update_item'       => CUSTOM_TAG_UPDATE_ITEM2,
                        'add_new_item'      => CUSTOM_TAG_ADD_NEW_ITEM2,
                        'new_item_name'     => CUSTOM_TAG_NEW_ITEM_NAME2    ),
                        'public'            => true,
                        'show_ui'           => true,
                        "rewrite"           => true 
                   )
    );
    //===============ACTIVE SECTION END================


    //===============PRODUCT SECTION START================
        register_post_type( CUSTOM_POST_TYPE3,
                    array(  'label'             => CUSTOM_POST_LABEL3,
                            'labels'            => array(   
                                        'name'                  =>  CUSTOM_POST_NAME3,//
                                        'singular_name'         =>  CUSTOM_POST_SINGULAR_NAME3,
                                        'add_new'               =>  CUSTOM_POST_ADD_NEW3,
                                        'add_new_item'          =>  CUSTOM_POST_ADD_NEW_ITEM3,
                                        'edit'                  =>  CUSTOM_POST_EDIT,
                                        'edit_item'             =>  CUSTOM_POST_EDIT_ITEM3,
                                        'new_item'              =>  CUSTOM_POST_NEW_ITEM3,
                                        'view_item'             =>  CUSTOM_POST_VIEW_ITEM3,
                                        'search_items'          =>  CUSTOM_POST_SEARCH_ITEM3,
                                        'not_found'             =>  CUSTOM_POST_NOT_FOUND3,
                                        'not_found_in_trash'    =>  CUSTOM_POST_NOT_FOUND_IN_TRASH3 
                            ),
                            'public'            => true,
                            'can_export'        => true,
                            'show_ui'           => true, // UI in admin panel
                            '_builtin'          => false, // It's a custom post type, not built in
                            '_edit_link'        => 'post.php?post=%d',
                            'capability_type'   => 'post',
                            'menu_icon'         => get_bloginfo('template_url').'/images/product.png',
                            'hierarchical'      => false,
                            'rewrite'           => array(   "slug" => CUSTOM_POST_TYPE3 ), // Permalinks
                            'query_var'         => CUSTOM_POST_TYPE3, // This goes to the WP_Query schema
                            'supports'          => array(   
                                                    'title',
                                                    'author',
                                                    'excerpt',
                                                    'thumbnail',
                                                    'comments',
                                                    'editor',
                                                    'trackbacks',
                                                    'custom-fields',
                                                    'revisions'
                            ) ,
                            'show_in_nav_menus' => true ,
                            'taxonomies'        => array(CUSTOM_CATEGORY_TYPE3,CUSTOM_TAG_TYPE3),
                            'menu_position' => 6
                    )
        );

    // Register custom taxonomy
    register_taxonomy(  CUSTOM_CATEGORY_TYPE3,
            array(  CUSTOM_POST_TYPE3   ),
            array ( 
                    "hierarchical"      => true,
                    "label"             => CUSTOM_TAXONOMY_LABEL3,
                    'labels'            => array(   
                                'name'              =>  CUSTOM_TAXONOMY_NAME3,
                                'singular_name'     =>  CUSTOM_TAXONOMY_SINGULAR_NAME3,
                                'search_items'      =>  CUSTOM_TAXONOMY_SEARCH_ITEM3,
                                'popular_items'     =>  CUSTOM_TAXONOMY_POPULAR_ITEM3,
                                'all_items'         =>  CUSTOM_TAXONOMY_ALL_ITEMS3,
                                'parent_item'       =>  CUSTOM_TAXONOMY_PARENT_ITEM3,
                                'parent_item_colon' =>  CUSTOM_TAXONOMY_PARENT_ITEM_COLON3,
                                'edit_item'         =>  CUSTOM_TAXONOMY_EDIT_ITEM3,
                                'update_item'       =>  CUSTOM_TAXONOMY_UPDATE_ITEM3,
                                'add_new_item'      =>  CUSTOM_TAXONOMY_ADD_NEW_ITEM3,
                                'new_item_name'     =>  CUSTOM_TAXONOMY_NEW_ITEM_NAME3  
                    ),
                    'public'            => true,
                    'show_ui'           => true,
                    "rewrite"           => true 
            )
    );


    register_taxonomy(CUSTOM_TAG_TYPE3,
                    array(  CUSTOM_POST_TYPE3   ),
                    array(
                        "hierarchical"      => false,
                        "label"             => CUSTOM_TAG_LABEL3,
                        'labels'            => array(   'name'              => CUSTOM_TAG_NAME3,
                        'singular_name'     => CUSTOM_TAG_SINGULAR_NAME3,
                        'search_items'      => CUSTOM_TAG_SEARCH_ITEMS3,
                        'popular_items'     => CUSTOM_TAG_POPULAR_ITEMS3,
                        'all_items'         => CUSTOM_TAG_ALL_ITEMS3,
                        'parent_item'       => CUSTOM_TAG_PARENT_ITEM3,
                        'parent_item_colon' => CUSTOM_TAG_PARENT_ITEM_COLON3,
                        'edit_item'         => CUSTOM_TAG_EDIT_ITEM3,
                        'update_item'       => CUSTOM_TAG_UPDATE_ITEM3,
                        'add_new_item'      => CUSTOM_TAG_ADD_NEW_ITEM3,
                        'new_item_name'     => CUSTOM_TAG_NEW_ITEM_NAME3    ),
                        'public'            => true,
                        'show_ui'           => true,
                        "rewrite"           => true 
                   )
    );
    //===============PRODUCT SECTION END================
    }
    ?>

If it's helpful to you,Please add this as answer then. You can mark it as solved in two days. Help us helping you and later users with keeping the site clean,thanks!

share|improve this answer
    
Thank you liying but I'm not sure you answer my question (if so, please forgive me, I may not have understood it well). I don't ask for custom categories at all and don't complain about my plugin not working. I want to use the standard categories for any post type and it works as it is. I just don't want the categories link to appear several times on the left admin bar (you know, just under the "list posts" and "add post" links). What I want is to have categories and tags having their own top level menu link outside of any post type menu and at the same level. I hope I made myself clearer. –  Baylock Jan 30 '13 at 2:52
    
I'm sorry for misunderstanding u,how about this plugin:Admin Menu Editor –  liying Jan 31 '13 at 7:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.