How to add a class to a WooCommerce product within the product loop
How to add a class to a WooCommerce product within the product loop I would like to add multiple bootstrap col classes to this line of code inside the product loop but I have no idea. <li><?php wc_product_class(); ?></li> Can I somehow push my classed into this bit of php and still keep the product applied? 2 Answers 2 try this <li <?php wc_product_class("col-md-4 col-sm-6 custom-class m-4"); ?>></li> <li <?php wc_product_class("col-md-4 col-sm-6 custom-class m-4"); ?>></li> For this wc_product_class(); uses two arguments one is class name and other one is product id so just pass your class name as first argument and product id in second one. wc_product_class(); you could see the wc_product_class() in /woocommerce/includes/wc-template-functions.php For example your class name is test and product id is 143 then just pass ...