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 am building a custom menu section (a new item with subitems in the main menu section on the left side) in the WordPress Administration of my website. The section shall include a main post type, and for this you should be able to link category and country.

It would be possible to use taxonomies, but taxonomy only supports multiple choices. Therefore, I want to be able to create new post types for category and country instead of taxonomies.

But it won't work out if I want it to be under the same menu section? Please help.

share|improve this question
    
It probably helps if you write what a menu section actually is. Is it a main entry in the admin menu that is displayed on the left side in the admin? Then it's probably more clear what does not work. Please edit your question accordingly, because with the current description I do not know if I really understand your problem. –  hakre Nov 17 '10 at 12:58
    
Okey. I have done that now. Please help me. –  Peter Westerlund Dec 2 '10 at 9:47

2 Answers 2

WordPress let's you define where a post type appears in the args where you register it. It's the show_in_menu argument. You can set it to true, false or a the slug (a string) of the page under which you'd like it to appear.

So, let's say you already have a post type "main". To display another post type under that you'd set the show_in_menu argument, like so:

<?php

// the register the post type
add_action( 'init', 'wpse4178_register' );
function wpse4178_register()
{
    // probably some more args up here.
    $args['show_in_menu'] = 'edit.php?post_type=main';
    register_post_type( 'country', $args );
}
share|improve this answer
    
Your $args array must be inside of your function. –  Pippin Nov 6 '11 at 15:31
    
thanks Pippin, missed that. –  chrisguitarguy Nov 6 '11 at 15:33

You need to modify the menu individually by code, most certainly by a plugin. Administration Menus (Wordpress Codex) contains a lot of information how the menu can be controlled. If nothing helps, you can directly control the menu via the associated global variable.

share|improve this answer

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.