Support » Themes and Templates » highlight parent pages on menu, when child page is showing

  • Resolved nagia_amrit

    (@nagia_amrit)


    hi,

    I’m using twenty eleven, i have created a child theme already, no website preview available as currently is on localhost.

    The thing is i have a custom menu on top of the page eg “Home”, “About us” , etc

    Now i have several pages under About Us eg our team that underneath has other pages (these pages are not visible on the menu, i used custom menu) and when someone sees them, i want the About us page to be highighted.

    I’ve changed the

    #access li.current-menu-item,
    #access li.current-menu-ancestor,
    #access li.current-menu-parent,
    #access li.current_page_item,
    #access li.current_page_ancestor,
    #access li.current_page_parent{
    font-weight: bold;
    color: #003f87;
    }

    but it doesn’t work.

    Any help/advice appreciated

    Many thanks 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Can you Pastebin.com your HTML and CSS for this menu?

    Hi Andrew yes

    html
    css

    many thanks

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    I can only see a ‘home’ menu item.
    Can you grab the HTML from the ‘view-source’ window of the web page?

    html

    sorry for that

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Does the list item, that has children, have the classes you’re specifying in the CSS?
    It’s just the code you’ve linked doesn’t have any children elements and therefore neither ancestral/ parent classes.

    oh ok thanks

    is it cause i’m trying to link a page to the menu?
    should i create a class for that?

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Yes these classes should be created somehow to relevant menu items

    current_page_ancestor

    and

    current_page_parent

    many thanks 🙂

    Hi Andrew,
    i’ve done that, but the thing is, that i have created a custom menu. which doesn’t have any subpages (drop down) only the main pages eg Home, About Us, Services etc. However, each page has a diff sidebar. I am trying to highlight the pages on the menu whenever a page from the sidebar is selected(and of course i have already added the menu page as a parent). (if that makes any sense)
    It’s working on the custom menu, if i drag and drop the pages under its parent one. But i don’t want that. I don’t want the drop down menu. Is there a way to do it? Either hide the dropdown menu but keep its settings?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘highlight parent pages on menu, when child page is showing’ is closed to new replies.