Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Now that wordpress 3.1 is out, where is the documentation for grouping custom post types together in the wp backend?

share|improve this question
1  
When you say group, what do you actually mean sorry? I'm not following. Do you mean relate post types to one another? – DigitalSea Mar 13 '11 at 2:47

1 Answer

up vote 1 down vote accepted

If you are wondering how to group multiple post types under one menu, you can easily do this with the show_in_menu argument when setting up your menu. See below:

$args = array(
 'public' => true,
 'show_ui' => true, 
 'query_var' => true,
 'rewrite' => true,
 'capability_type' => 'post',
 'hierarchical' => false,
 'show_in_menu' => 'your-custom-menu-slug.php',
 'menu_position' => null,
 'supports' => array('title','editor','custom-fields'),
 'has_archive' => true
);
register_post_type('your-post-type',$args);

Note: For this to work, show_ui must also be set to true.

Then you would create a menu using the add_menu_page function.

function add_your_menu() {
  add_menu_page( 'Multiple Post Types Page', 'Multiple Post Types', 'manage_options', 'your-custom-menu-slug.php', 'your_menu_function');
  // add_submenu_page() if you want subpages, but not necessary
}
add_action('admin_menu', 'add_your_menu');

In the same fashion, you can also attach post types to any existing menu. For example, it might be useful to attach certain post types to 'Posts' and others to 'Pages', while others might belong in 'Tools'. If you attach to an existing menu, you can ignore the add_menu_page function above and just modify the $args when registering your custom post type.

share|improve this answer
Thank for this answer. It work, but it only display all post of each custom post type and not display taxonomy(or category) of that of each custom post type. Can you help me, please? Thank you very much. – mary Dec 26 '12 at 4:54

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.