R
R
r_g_b_a2021-03-06 09:19:53
WordPress
r_g_b_a, 2021-03-06 09:19:53

How to determine in woocomerce in the catalog card template in which shortcode it is displayed?

I have a category product card (content-product.php) displayed in several places - on the archive page and on the main page in several shortcodes. I want to give it an additional css class in case it was shown with the [recent_products] shortcode. How can I determine this?
At the moment, I use this option for styling, but I don’t really like it, I have to redefine a lot of styles:
[recent_products class="recent-products"]
.recent-products .product {...}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question