WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Duplicate menu item with add_menu_page and add_submenu_page (5 posts)

  1. Slobodan Manic
    Member
    Posted 3 years ago #

    Hi,

    I added theme options page (titled MyTheme) using add_menu_page function, then submenu with add_submenu_page (titled Documentation) and it all works fine. However, when I look at this new menu i created, i see this:

    MyTheme (title of admin menu)
    - MyTheme (appearing again, with same link, although it wasn't added)
    - Documentation (submenu item I added)

    Is there a way to change text for 'MyTheme' submenu item so it's not the same as the one above it?

    Thanks!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. Slobodan Manic
    Member
    Posted 3 years ago #

    Esmi, thanks for this link! It's a goldmine, exactly what I needed.

    Back to the drawing board for me, I appreciate your help.

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    No problem. The real thanks should go to Chip Bennett who wrote such an excellent tutorial. :-)

  5. Slobodan Manic
    Member
    Posted 3 years ago #

    Absolutely. The longest and most extensive tutorial I've seen in a long time :)

    The reason I went with add_menu_page was because I wanted to have another submenu page (along with the one where options panel would be) that would have theme documentation in it, or links to various documentation pages on my server.

    But now that you (and Chip) suggested, it might make more sense not to add a top level page, documentation in a tab inside the page created using add_theme_page will be enough.

Topic Closed

This topic has been closed to new replies.

About this Topic