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've created a menu page in the dashboard, then I created a custom post type and now I want to put the menu of the custom post type as a submenu under the first menu page I had created. I tried

'show_in_menu' => 'admin.php?page=mytestpage',

However that did not work. Any tips?

share|improve this question
    
DO you want to add the Custom Post under an Admin menu item? like: Post -> Custom post ? –  Pontus Abrahamsson Jul 12 '12 at 10:51
    
Yes but not under Post, under one of my custom created menu items. –  drtanz Jul 12 '12 at 12:00
1  
way not the other way around? create the custom post type and add your custom page as sub page to that. –  Bainternet Jul 12 '12 at 13:11
    
That's what I ended up doing, operation successful thanks –  drtanz Jul 12 '12 at 23:46

2 Answers 2

You only need to add the page slug to "show_in_menu", making the answer to your example:

'show_in_menu' => 'mytestpage',

For a more complete example:

Admin/Settings page of: /wp-admin/admin.php?page=mytestpage

register_post_type('mycpt', array('label' => 'My Custom Post Type', 'capability_type' => 'post', 'show_ui' => true, 'show_in_menu' => 'mytestpage'));
share|improve this answer
up vote 1 down vote accepted

Ended up creating the custom post type and adding my custom page as sub page to that, as suggested by Bainternet

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.