Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Woocommerce Storefront product category page color change

I have changed the primary-navigation-menu current page color by below CSS

.current_page_item a {
    color: #4fff51!important; }

But it is working for only pages not for product category pages.

In the menu, Home & Shop are the pages and remaining are the product category pages.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How to fix this ..?

pls visit my site graceamaron.com

thank you

>Solution :

Because the product pages are children of Store the store list item is not seen as the current page, so you will have to add an extra class to select by parent. You do this by adding .current_page_parent a to the CSS.

After looking a bit further through your site, I also saw the following link still shows up gray: https://graceamaron.com/product-category/homeups/

if you add .current-menu-item a to the CSS, it will also change the color for this nav item.

To make your cart green as well when selected, add .site-header-cart .current-menu-item a to the class.

To solve these issues, change your class to the following:

.site-header-cart .current-menu-item a,
.main-navigation .current_page_parent a,
.main-navigation .current-menu-item a,
.main-navigation .current_page_item a {
    color : #4fff51!important;
}

Previews of the class working:

Product Page:
enter image description here

Category Page:
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading