P
P
Polina Nefedova2020-04-25 12:08:47
WooCommerce
Polina Nefedova, 2020-04-25 12:08:47

How to apply custom class in woocommerce for product category and product card?

Good afternoon guys, I'm not a programmer and for me it's a forest, but I still figured out a bit what and how, and now I faced a problem. when I got to the design of the product card and product category, I can’t set my own class for each, not for headings, not for images. It turns out that if I take some class that exists and set my own parameters for this, then it changes both in the category and on the product cards. Here's how not to learn how to finish your class? help plizzzzz) otherwise the brain has been boiling for 3 days already

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pychev Anatoly, 2020-04-25
@stvik

You just need to write your css rules with reference to the parent element.
Take a look at the tag <body>for the category page and product card. You will find different classes that define your page.

/* например*/
body.archive .мой-класс {
   ... стили для страницы категории
}
body.single-product .мой-класс {
   ... стили для карточки товара
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question