Hello !
I’ve customized the columns number by default (3) for woocommerce shop, but i would like to display 2 columns only for some specifics categories ?
Is there a way to do that ?
Thanks very much, have a nice day
Arnaud
Ok, found it !
Two specifics categories with ID 539 and 805, displayed with 2 columns :
► in functions.php :
add_filter(‘x_option_x_woocommerce_shop_columns’, ‘x_term_column’);
function x_term_column ( $cols ) {
if ( is_product_category() && (get_queried_object()->term_id == 539 || get_queried_object()->term_id == 805) ) {
return 2;
}
return $cols;
}
Thanks 
Hello @Arnaud,
We are just glad that you have figured out a way to resolve your inquiry.
We really appreciate for letting us know!
Best Regards.
1 Like
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.