I am facing issue on wordpress active menu link, by default it set current-menu-parent class on parent link and set current-menu-item class on current link in navigation.
Here you will see active classes working fine,
https://lifedxb.com/linen-leather/product-category/women/tops/
But when i click on any product, and its detail page get opened. e.g.
https://lifedxb.com/linen-leather/product/top-licia/
On any product detail page, all of active classes get removed, is there any solution to keep my classes active on product detail pages?
Please try this code. I hope it will solve your problem.
Go your product detail page. Find ul/submenu class/you have write there inline css “display: none”. Please replace this inline-css with “display: block;”
Like this->
<ul class=”sub-menu” style=”display: block;”>
<li id=”menu-item-251″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-251″>Dresses
<li id=”menu-item-252″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-252″>Tops
<li id=”menu-item-253″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-253″>Scarves
We have correct this block. You can also replace this block of code with your code.
Thanks.
]]>