i found this in custom-functions.php
add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 10 );
What does thim_woocommerce_columns_product function look like?
i added this …
add_filter( 'loop_shop_columns', 'wc_loop_shop_columns', 1, 10 );
/*
* Return a new number of maximum columns for shop archives
* @param int Original value
* @return int New number of columns
*/
function wc_loop_shop_columns( $number_columns ) {
return 2;
}
but it didn’t do anything
If whatever thim_woocommerce_columns_product is is also changing columns, yours won’t affect things.
i just tried:
// Change number or products per row to 3
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3; // 3 products per row
}
}
nothing
Oh – sorry Mike … didn’t see your comments.
i’m going to look for the thim_woocommerce_columns_product function now … i think i’ll find it in the theme files … i think. :s
If you want yours to take priority if you cannot find it, change to this:
add_filter( 'loop_shop_columns', 'wc_loop_shop_columns', 20 );
i found this …
/**
* Filter columns product in archive product
*/
if ( ! function_exists( 'thim_woocommerce_columns_product' ) ) {
function thim_woocommerce_columns_product( $current ) {
if ( is_archive() ) {
$theme_options_data = thim_options_data();
if ( isset( $theme_options_data['thim_woo_cate_columns'] ) ) {
return intval( $theme_options_data['thim_woo_cate_columns'] );
} else {
return 3;
}
}
return $current;
}
}
//add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 10 );
add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 1, 10 );
/*
* Return a new number of maximum columns for shop archives
* @param int Original value
* @return int New number of columns
*/
function wc_loop_shop_columns( $number_columns ) {
return 2;
}
maybe it’s set up somewhere to put six in a row …. that would explain the wonky-ness … right?
Sorry – it doesn’t change anything. I put it in functions.php in the child theme. not the custom-functions.php. Should I have?
I replaced:
add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 10
with
add_filter( 'loop_shop_columns', 'wc_loop_shop_columns', 20 );
this no change.
link to page: newsstand
It has classes for 2 column, but I don’t think the CSS has a rule to clear on .first.