Winnes wordpress theme – woocommerce shop page product per row is stuck at 3?

View QuestionsCategory: QuestionsWinnes wordpress theme – woocommerce shop page product per row is stuck at 3?
admin Staff asked 5 years ago

I tried to go to theme -> customize – woocommerce – change it to 4 for desktop. But it is always showing at 3.

How to fix?

1 Answers
Best Answer
admin Staff answered 5 years ago

The get theme options function has bug. (The customization options were never saved as a theme option properly in DB.) As a result it always uses the defaults.

Change the hard coded defaults below for your desired values.

File: /wp-content/themes/winnes/inc/woocommerce/theme-woocommerce-shop.php

 

/**
* Zoo get product columns shop page
* @uses call function zoo_shop_columns() with parameter device (mobile/table/desktop)
* @return this function will return shop columns follow device.
**/
if ( ! function_exists( 'zoo_shop_columns' ) ) {
function zoo_shop_columns( $device = 'desktop' ) {
if ( $device == 'tablet' ) {
$cols = get_theme_mod( 'zoo_shop_cols_' . $device, 4 );  //change the 4
} elseif ( $device == 'mobile' ) {
$cols = get_theme_mod( 'zoo_shop_cols_' . $device, 2 );  //change the 2
} else {
if ( isset( $_GET['cols'] ) ) {
$cols = $_GET['cols'];
} else {
$cols = get_theme_mod( 'zoo_shop_cols_' . $device, 5 ); //change the 5
}
}

return $cols;
}
}