I have a nav menu with a depth of 2.
wp_nav_menu( array( 'theme_location' => 'primary_navigation',
'depth' => 2
) );
When I am active on a page in the nav menu that has no children, that li
menu item has active
appended. However, when the menu item has children, has-children
is appended, but no 'active' or even a related class name.
<ul id="menu-main-top-navigation">
<li class="parent1"></li>
<li class="has-dropdown not-click">
<ul class="dropdown">
<li class="child1"></li>
<li class="child2"></li>
</ul>
</li>
<li class="parent3"></li>
<li class="parent4"></li>
<li class="active parent5"></li>
<li class="parent6"></li>
</ul>
In this case I am the page relating to menu item 'parent5'. This is fine. When I navigate to what is meant to be 'parent2', the class name is replaced completely with 'has-dropdown' so there is no differing class name or 'active'.
How can I fix this. Even to remove the JQuery in this case.