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

I am trying to create a link under a custom post type I have named "portfolios". If I change "add_submenu_page" to "add_options_page" it correctly shows a new link under the "Settings" menu. But it won't seem to go in the portfolios menu, what am I doing wrong here?

    add_action('admin_menu', 'mt_add_pages');


    function mt_add_pages() {
    add_submenu_page(__('portfolios','menu-test'), __('Test Settings','menu-test'), 'manage_options', 'testsettings', 'mt_settings_page');


    function mt_settings_page() {
    echo "<h2>" . __( 'Test Settings', 'menu-test' ) . "</h2>"; 

    }

    }
share|improve this question

migrated from stackoverflow.com Aug 27 '12 at 12:56

2 Answers

It looks like you are looking for labels for custom post types. You can get an example on this website: http://teamtreehouse.com/blog/create-your-first-wordpress-custom-post-type

share|improve this answer

add_options_page automatically adds it underneath settings, however add_submenu_page gives you control as to where you want it to show up.

Try something like this:

add_submenu_page('edit.php?post_type=portfolios', __('Test Settings','menu-test'), 'manage_options', 'testsettings', 'mt_settings_page');

Documentation: https://codex.wordpress.org/Function_Reference/add_submenu_page

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.