0

I created an options page for admin and displayed it as a top level menu -> add_menu_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');

I want to add a sub menu under the top level menu I created to display exactly the same page (to be displayed as a sub menu but open this page also when user clicks the top level menu).

Also I don't know how to add another theme page I created under this top level menu. I have read the wordpress documentation and couldn't make it, before asking here. Many thanks.

1 Answer 1

1

Try using add_submenu_page for adding a submenu for the extra entry. Once you add one submenu entry, by default you will have 2 subitems: the parent one (the same as the root item) and the new subitem. This is a default behavior from WordPress (replicating the parent element as the first row when you have other subpages).

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.