WordPress.org

Forums

Custom Menu Widget - Need to Show Parent and Submenu of Active Page (4 posts)

  1. LValfre
    Member
    Posted 1 year ago #

    http://test.pillarsoflifebook.com/

    Simply using a custom menu widget on the left sidebar. I've done a lot of CSS to get it looking this way (at least for me it was a lot of trial and error, reading and searching, and learning of course! : ) ).

    I'm stuck though!

    1. When you click on Banquettes the sub menu appears how I want it to. When you click on the next level, say designer, the menu stays how I want it to and the active page is highlighted. The parent loses it's highlighting though. I do want the parent (Banquettes) to stay highlighted too.

    2. Bigger Issue - When I click on a page from the designer set I'm now in the 3rd level but NONE of the parent sub menu shows anymore. I still want Banquette, it's sub menu, and the active parent links highlighted. It shows where they're at.

    I'd appreciate any help! I'm trying to sort this out for a client and am at a sticking point.

    Thank you kindly!

  2. LValfre
    Member
    Posted 1 year ago #

    I figured out number 1. This CSS code seemed to fix it.

    .sidebar .current_page_parent a {
    font-weight:bold;
    color: #0E2C60;
    }
    
    .sidebar ul li li.menu-item a {
    font-weight: normal;
    color: #ffffff;
    }

    The current_page_parent affected all of the submenu items so I had to add a more specific menu-item specification to put them back how I wanted.

    I don't fully understand the ul li li.class ul li etc syntax but played with it and got lucky. Any links for further reading are appreciated.

    All I need now is to get the parent/sub to display when on a child page of that sub. I added a page to the custom menu under designer to test and sure enough the menu showed. I don't want to add the final pages in the custom menu at all though.

    Current Custom Menu example:
    Banquette
    Designer
    Traditional

    When on designer I have page shown that are children of Designer. When I click on them the submenu dissapears. If I had the children to custom menu under designer the menu shows. Anyway to bypass this?

    This Worked - Custom Menu example:
    Banquette
    Designer
    Product Page (menu shows but don't want product pages in custom menu)
    Traditional

  3. LValfre
    Member
    Posted 1 year ago #

    It seems with Custom Menus you won't get the current_page_ancestor class unless there are children in that menu. The page structure does have children but unless I put them in the custom menu it doesn't work.

    Is there a way around this?

  4. soybean80
    Member
    Posted 1 year ago #

    I have a very similar issue, however, my parent menu uses icons, so using the OP as an example,

    If Banquette is highlighted it would be:

    .sidebar .menu .banquette a { background: url(images/banquette.png) no-repeat; }
    .sidebar .menu .banquette a:hover,
    .sidebar .menu .banquette a:focus,
    .sidebar .menu .banquette a.active { background: url(images/banquette_selected.png) no-repeat; }

    How would I set the sub navigation (designer, traditional) to capture that behavior?

Topic Closed

This topic has been closed to new replies.

About this Topic