Hello Kenmontgroup,
Most likely you are targeting the current_page_parent class with your CSS to create and active state. For targeting 2 levels or more above the current item, you may use the current_page_ancestor class.
For example, if you have the highest level parent showing your CSS could look something like this:
.advanced-sidebar-menu .parent-sidebar-menu > .current_page_parent,
.advanced-sidebar-menu .parent-sidebar-menu > .current_page_ancestor {
font-weight: 700;
}
Have a great weekend!
Hello, thanks so much for the quick reply and guidance!
I tried that, but unfortunately did not work. I did inspect the main menu list item while visiting both 2nd and 3rd tier pages from the sidebar and noticed the following differences in the ‘li class’ for each:
On any 2nd tier page (where the main menu item active state is styling properly), the ‘li class’ is:
<li class=”menu-item menu-item-type-post_type menu-item-object-page current-page-ancestor current-menu-ancestor current-menu-parent current-page-parent current_page_parent current_page_ancestor menu-item-has-children menu-item-824″>
On any 3rd tier page (where there is no active state styling on the main menu item), the ‘li class’ is:
<li class=”menu-item menu-item-type-post_type menu-item-object-page current-page-ancestor menu-item-has-children menu-item-824″>
So, on the 3rd tier pages, the li classes of “current-menu-ancestor current-menu-parent current-page-parent current_page_parent current_page_ancestor” are missing and therefore not making the primary nav menu item active when on those pages.
Any further ideas? Thanks!
Based on what you provided, it appears your site is using current-page-ancestor instead of current_page_ancestor.
If which case, you’ll need to adjust the example CSS to account for the change.
.advanced-sidebar-menu .parent-sidebar-menu > .current-page-parent a,
.advanced-sidebar-menu .parent-sidebar-menu > .current-page-ancestor a {
font-weight: 700;
}
Have a great weekend!
That worked – thank you so much for the additional guidance and quick follow-up! Have a great weekend!