From ba2091f6a17c2879f71aad063b102ad12741d474 Mon Sep 17 00:00:00 2001 From: Thuan Bui Date: Sun, 5 Nov 2017 13:23:26 +0700 Subject: [PATCH] functions.php update --- functions.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 91fa618..bb1c06b 100644 --- a/functions.php +++ b/functions.php @@ -408,9 +408,10 @@ function themeprefix_cpt_layout() { add_filter( 'genesis_site_layout', 'themeprefix_cpt_layout' ); // 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 +add_filter( 'loop_shop_columns', 'tm_product_columns', 5); +function tm_product_columns($columns) { + if ( is_shop() || is_product_category() || is_product_tag() ) { + $columns = 3; + return $columns; } } \ No newline at end of file