• Resolved nissa1982

    (@nissa1982)


    Who could help me with my active menu item.

    The way my website is now, I don′t know where I am on the site, since the active menu item of the page I′m visiting isn′t highlighted to make it different from the non active menu items. Now, it only is highlighted when hovering the item.

    So, I would like the active menu item (also if it is just a sub menu item) to be in white for as long as I am visiting that page in order to highlight the current page that you I′m on. I would love it to get back to light grey (like it is now when it is inactive) as soon as I leave the active page.

    I already tried:

    $(‘.menu a’).filter(function() {
    return this.href == url;
    }).addClass(‘better-active’);

    Does anyone know the solution?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • There is already a class: current_page_item which I think should work on the main level. For ancestors there are classses current-menu-ancestor, current-menu-parent, current_page_parent, current_page_ancestor, menu-item-has-children..

    adding following in to the “additional CSS” renders an awful yellow background on the actual current active page.

    .current_page_item,
    .current-menu-ancestor {
    	background-color: yellow;
    }
    • This reply was modified 6 years, 10 months ago by chzumbrunnen.
    Theme Author Anders Norén

    (@anlino)

    Hi @nissa1982,

    I’ll add styling for the current menu item in the next version of Hitchcock. Until then, you can follow the instructions added by @chzumbrunnen to add your own active styling. Instead of the yellow background color, you can add the following to make the current menu item styling match the link hover styling in the menu:

    .main-menu .current_page_item > a,
    .main-menu .current-menu-ancestor > a {
        color: #fff;
    }

    (This will probably be the current menu item style added in the theme update as well.)

    — Anders

    • This reply was modified 6 years, 10 months ago by Anders Norén.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘highlight active menu’ is closed to new replies.