Garry
Garry

Reputation: 63

Target only single product pages with CSS in WooCommerce

With CSS I am basically hidding quatity fields in WooCommerce using display:none. But it removes quantity fields on Cart and Wishlist pages as well.

How can I only target single product pages?

I can do it by page ID as well but I have 100's of products and it's just not a practical way to do it.

Upvotes: 4

Views: 4666

Answers (1)

LoicTheAztec
LoicTheAztec

Reputation: 254373

To target Woocommerce Single product page just use the <body> class single-product.

Like for example to hide quantity fields (only on single product pages):

.single-product .quantity {
    display:none;
}

Upvotes: 3

Related Questions