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.

My theme currently has a single menu on the left hand sidebar of WP admin. I want to include submenus on that menu.

How can I add, for example, a single submenu item to the "Theme Options" menu below?

add_menu_page(
    "My Theme Options", 
    "Theme Options", 
    'edit_themes', 
    basename(__FILE__), 
    'my_admin', 
    get_bloginfo('template_directory') .'/img/favicon.png'
    );
share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

To do that, you would use add_submenu_page().

But I would strongly recommend against making submenu pages for Theme options. To begin with, you should be using add_theme_page() for your Theme options page, so that your Theme options page itself is properly placed as an Appearance sub-menu page.

share|improve this answer
add comment

Use add_submenu_page()

It uses pretty much the same structure, but takes the parent-menu slug or file name as the first argument.

share|improve this answer
add comment

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.