Current Page parent with 3 levels.
Hi there. I am sure this is simple, but I need a class that is only applied to the top level pages. The menu system is setup a bit differently on my site. Basically 3 levels.
Heres the CSS:
header nav ul > li.active > a,
header nav ul > li.current-page-parent > a {
background: rgba(28,147,205,.5)
Menu Item #1 -- Sub Menu One ---Third Level Item #1 ---Third Level Item #2 -- Sub Menu Two
If i select a third level item, it highlights its parent, but not the top level navigation parent. I have tried this with > and without. Is there a way to add a class specifically to just top level parents that contain an active child? With the design I have in place, the send level item shouldn't highlight unless it is the current page.
WordPress's default parent hierarchy classes are applied, you simple need to add them to your css code.
Could you tell me specifically what the class name is? Because i don't see any unique to top level class names.
These are what I see: menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-110 dropdown
I had to use JS for the time being to add an active class if the third level down item was listed as active.
As referenced in issues #81
There is an active class applied to the parent but it is not its not called active walker outputs the standard WordPress classnames. You should style current-post-parent. This is makes it extremely simple if you are using LESS to compile your CSS as you can actually reference a class name and its properties inside another class.
.current-post-parent > a {
.navbar-nav > .active > a;
}
.current-post-parent > a:hover {
.navbar-nav > .active > a:hover;
}
When you compile this it should automatically apply the bootstrap active styles to the .current-post-parent class.
.current-menu-parent a { color: #d7b22e !important; }