Adding CSS class to navigation element dynamically in WooCommerce
Adding CSS class to navigation element dynamically in WooCommerce
I have a WooCommerce site with the following Products permalink structure: /products/shop/
The client wants a custom "Product" page rather than the default generated one. The challenge is that the actual product pages don't trigger the navigation product link to have an active state. I can't make it have the same active orange background color as the non WooCommerce pages within that group of pages.
Do you have any ideas on dynamically adding a class to the menu item when a product page is viewed so I can style the navigation element?
Link to development site:
https://wordpress-1164757-4160273.cloudwaysapps.com/products/
https://wordpress-1164757-4160273.cloudwaysapps.com/products/shop/bp-protease-003-1000/
Turbo Multi-language Translator
Make the better internet purchasing globaly
Turbosify SEO Speed Booster
5.0 (7)•Free plan available
Get better conversions by improving store loading speed
Installed
Turbo Multi-language Chat - AI Customer service in one hand