I'm working on site where I need to setup products to be showed in to 2 rows, instead of the default 3 for all other products categories. I searched into Stack and Google and found this useful answer, where the asnwer was writen in this function:
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
if ( is_product_category('torres-elevadoras')) { // wanted product category
return 2;
}
}
This doesn't seem to take effect when inserting into the functions.php file into my theme. Are some coding changes into latest Woo 3.4.1 that making this function not work anymore?
EDIT: When inserting this CSS, it shows me products into two columns, but for all category. How to apply for wanted product category?
.woocommerce div.product {
width:50%;
}