[resolved] create main menu-highlight current page even when on child (3 posts)

  1. Bill Weye
    Posted 9 years ago #

    I am trying to use wp_list_pages (or not, I'm flexible) to create a main menu that will output only some of my top level pages, not their children. No problem there.

    But, I want some class to be output (.current_page_item for example) on one of those parents when I am on a child of that parent.

    For example, when I am on "photos > my favorites" I want my top level page "photos" menu item to be identified as the active page.

    Is this possible?

    Thanks much, you're a peach!

  2. Andrew Ozz
    WordPress Dev
    Posted 9 years ago #

    The parent of the currently displayed page gets a second css class "current_page_parent"...

  3. Bill Weye
    Posted 9 years ago #

    I did not know that! Excellent, and sorry for the bother.

Topic Closed

This topic has been closed to new replies.

About this Topic