Site logo

Archived topic

Primary Navigation - custom link / anchors color

4 replies · Started by mor on May 4, 2017

Viewing posts 1–5 of 5

Primary nav has 6 items. 2 of these are anchors in the Home page. When on Home page "current" color applies to Home and these other 2 nav items. Is there any way to change it so the 2 anchors stay the non-current" color?

https://protectedmedia.wpengine.com/

First, give those menu items a class like: ignore-current-colors

https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes

Then, add this CSS:

/* Regular menu item colors */
.main-navigation .main-nav ul .ignore-current-colors.current-menu-item > a {
    background: #222;
    color: #FFF;
}

/* Regular menu item colors on hover */
.main-navigation .main-nav ul .ignore-current-colors.current-menu-item > a:hover {
    background: #222;
    color: #FFF;
}

BTW - nice site! If you want to fix the sticky menu overlapping with the regular menu, add this CSS as well:

#sticky-navigation {
    z-index: 9999;
}

Thank you! (just had to make the background transparent :) )

You're welcome :)

This archived topic is closed to new replies.