How To Add Class To Single Product In WooCommerce Category Page

If you need to add class to a single product in woocommerce category page, simply go to plugins/woocommerce/templates and copy the file content-product.php to yourtheme/woocommerce

On line 30, you will see the opening <li tag. This is the start of every product in the category page. Simply enter your tag in post_class and you will have your class appears on the category page.

<li <?php post_class("col-md-4 col-xs-6"); ?>>

How To Add Class To Single Product In WooCommerce Category Page 1

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

Year-End Super Sales

50% Off all WooCommerce plugins. Limited time offer.


Leave a Reply

Your email address will not be published. Required fields are marked *