Forums

get wordpress top-level menu title (5 posts)

  1. RockyMtnHi
    Member
    Posted 2 years ago #

    I want to show only the top-level menu item title associated with any page that is clicked in the menus and can't see how to do it.

    I've tried variations on wp_list_pages() and can't get it to work.

    Is this possible? If so, can you give a code example?

    Thanks

  2. Chantal
    Member
    Posted 2 years ago #

    Try wp_page_menu. See the codex for more information: http://codex.wordpress.org/Template_Tags/wp_page_menu

  3. RockyMtnHi
    Member
    Posted 2 years ago #

    Just don't see how that will do it either.

  4. Chantal
    Member
    Posted 2 years ago #

    Maybe you can explain a little bit more...

  5. RockyMtnHi
    Member
    Posted 2 years ago #

    I'm building a site with drop-down menus. When you select a top-level menu it is reflected by the menu item being highlighted. If you select a sub-menu then you don't know what category you are in because no menu items are highlighted.

    I want the code that reads the top-level menu title and places it in a spot at the top of the page so the user can see what section they are in.

    Make sense?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.