Current Page for 2 or more levels
Hi, this code displays only for one level up.
/* Vantage Current Menu Item Colors */
.main-navigation ul li.current-menu-item > a, .main-navigation ul li.current_page_parent > a {
color: #47ff14;
}I would like to know how to write for an extra menu level?
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
6Hi Mikael
Have you tried setting current menu colors from the Customizer > Theme Design > Menu, everything should be working properly there.
Yes, I’ll try it.
But that controls only the current page. I search for css to highlighting the parent pages too.
Sure. Here we go. Adjust as required.
/* Vantage Current Menu Item Colors */ .main-navigation ul li.current-menu-item > a, .main-navigation ul li.current_page_item > a, .main-navigation ul li.current-menu-parent > a { background-color: #000000 } .main-navigation ul li.current-menu-item > a, .main-navigation ul li.current-menu-item > a, .main-navigation ul li.current-menu-parent > a [class^="icon-"], .main-navigation ul li.current_page_item > a, .main-navigation ul li.current_page_item > a, .main-navigation ul li.current-menu-parent > a [class^="icon-"] { color: #ffffff }Hope that helps :)
Well since we already have the Customizer handling the regular current items we can just add this:
.main-navigation ul li.current-menu-parent > a { background-color: #000000 } .main-navigation ul li.current-menu-parent > a [class^="icon-"], .main-navigation ul li.current-menu-parent > a [class^="icon-"] { color: #ffffff }No sense in doubling up.
I found out this is working as I wanted it to.
/* Vantage Current Menu Item Colors */ .main-navigation ul li.current_page_ancestor > a{ color: #47ff14; }Do you have any donate button for the gratitude?
Awesome, really glad to hear that helped.
Thanks so much for your generous offer. Your support is more than enough :)
All the best with your site.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.