Hide shortcode class when no content
-
Hi,
On my website I’m using the “product-category” shortcode like this:
[product_category category=”entrepots” per_page=”12″ columns=”4″ orderby=”date” order=”desc” class=”product-entrepots”]I have put a class on this, so then I could use this kind of stuff to add a title for my products:
.product-entrepots:before { content: "Nos entrep?ts :"; font-weight: bold; }
My problem is, if there is no product in the given category, the title is still displayed. The only workaround I found was to put a display none in my css when there is no product, but then I have to consider myself if there are products in the category or not.
Isn’t there a way to not display the class at all if there is no product in the category?
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Hide shortcode class when no content’ is closed to new replies.