• Hi,

    I have a page as a “Menu Item” and Category Page as a “Parent Menu/Sub Item”. How to highlight the “Menu Item” when visit a post that have relevance with the Category in “Parent Menu/Sub Item” without having added Post to menu structure?

    Here are my CSS rules for that:

    .navbar .nav > li.current-menu-item > a,
    .dropdown-menu > li.current-menu-item > a,
    .navbar .nav > li.current-menu-parent > a,
    .dropdown-menu > li.current-menu-parent > a,
    .navbar .nav > li.current-menu-ancestor > a,
    .dropdown-menu > li.current-menu-ancestor > a {
        	color: #FA6F00 !important;
    }

    Related URL: https://www.nuxbox.com/linux-software/sample-post-2-of-linux-box/

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Can you please this in your Jquery files this may help you.

    $(‘.current-menu-parent’).parents(“ul.dropdown-menu”).parent(‘li’).addClass(“current-post-ancestor”);

    Thread Starter nuXbox

    (@nuxbox)

    Hi Ganeshpaygude,

    How exactly do I do that? What files, specifically, do I add code to?

    Thanks in advance!

    Thread Starter nuXbox

    (@nuxbox)

    Any other suggestions please..

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to highlight menu…’ is closed to new replies.