• I set up a WordPress Custom Menu (Appearance–>Menu) with just the top level pages listed. I don’t want to add children pages to create a drop down list, but I would like the parent page item to show as selected when you are on a child page.

    How do I do this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Try styling on .current-menu-parent and .current-menu-ancestor.

    Thread Starter robgnyc

    (@robgnyc)

    Thanks for the quick reply. They are already styled:

    /* you-are-here styles */
    #pagebar li.current_page_item > a,
    #pagebar li.current_page_parent > a,
    #pagebar li.current_page_ancestor > a,
    #pagebar li.current-cat > a,
    #pagebar li.current-menu-ancestor > a,
    #pagebar li.current-menu-item > a,
    #pagebar li.current-menu-parent a {
    background: url(images/buchcanan-menu-on.jpg) repeat-x;
    color: #56a0d3;
    text-decoration: none;

    }

    The styling works when you are on the page, just not when you are on the child. I can make it work by dragging the child below the parent in the menus screen but then it generates a drop down which I don’t want.

    So I either need to automatically have the parent highlighted on the child page or to be able to suppress the drop down when the child is under the parent in the menus screen.

    Try changing #pagebar li.current-menu-ancestor > a, to #pagebar li.current-menu-ancestor a,

    Thread Starter robgnyc

    (@robgnyc)

    That seemed to work. Thanks so much.

    No problem ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP Custom Menus Show as Selected on Child Pages’ is closed to new replies.