• Resolved gnorf

    (@gnorf)


    Hey there

    excellent theme and thanks for providing!

    One thing I was wondering about.

    When a submenu (level 2) is selected, and displayed active, how can I make parent/main menu also be displayed as active? What should be inserted and where?

    This is particularly relevant where main menu item is not in use (or with #) and everything is organized in submenus.

    Many thanks in advance!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Place the following CSS code in the Custom CSS box:

    .main-navigation .current_page_parent > a {
      background-color: #ddd;
      border-top: 3px solid #222;
      padding-top: 17px;
    }
    Thread Starter gnorf

    (@gnorf)

    Thanks very much but unfortunately it did not work. I also tried to insert the code below

    .main-navigation .current_page_item > a {
    	background: #ddd;
    	border-top: solid 3px #222;
    	padding-top: 17px;

    No change, when submenu is active main menu remains inactive.

    It is .current_page_parent and NOT .current_page_item.

    Thread Starter gnorf

    (@gnorf)

    Now I am slightly confused. sorry.

    I know the differences, does this mean your code shall replace the one in the css? I inserted yours below the one quoted. Which was in the sheet

    Thread Starter gnorf

    (@gnorf)

    Well as removing that means menu will not show active even when active I guess they should complement each other. But it still won’t work.

    The code should be added in WP-Admin > Appearance > Coller Settings > Custom CSS. But turns out that the > character is converted to &gt ; in this file πŸ™

    So create a child theme and place the code in its style.css file.

    Thread Starter gnorf

    (@gnorf)

    Thanks, yes I did that and I also saw the additional characters + removed them.

    Either way, via the custom CSS box or by direct insert into style.css, didn’t work. Main menu remains inactive if submenu is active on page select.

    Please post your site’s URL.

    Try this:

    .main-navigation .current-menu-parent > a {
      background-color: #ddd;
      border-top: 3px solid #222;
      padding-top: 17px;
    }

    The previous code I posted works only for subpage menus. But this code should work.

    Thread Starter gnorf

    (@gnorf)

    BINGO! Awesome! Thanks a million Jesin!

    I was pondering over that but too rusty with rgds CSS to make a sensible deduction/arrive at a sensible conclusion. One learns something new every day! πŸ™‚

    You’re welcome!

    Use the inspect mode (F12) of your browser to pin point an element on the webpage and get its code.

    Also please mark this thread as resolved if things are done.

    Thread Starter gnorf

    (@gnorf)

    Yessir will do! I did use the inspector but was not sure about the css state term to be used.

    Case closed πŸ™‚

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Parent menu active when submenu active’ is closed to new replies.