From 3353d80ecd60a7acd97de1ac1d2601d9bf8ba098 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 22 Feb 2018 15:44:28 +0000 Subject: [PATCH] wc_get_loop_class; force columns to be a minimum of 1 --- includes/wc-template-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 09c645635a7..bb6f99af95a 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -380,7 +380,7 @@ add_action( 'after_switch_theme', 'wc_reset_product_grid_settings' ); */ function wc_get_loop_class() { $loop_index = wc_get_loop_prop( 'loop', 0 ); - $columns = wc_get_loop_prop( 'columns', wc_get_default_products_per_row() ); + $columns = absint( max( 1, wc_get_loop_prop( 'columns', wc_get_default_products_per_row() ) ) ); $loop_index ++; wc_set_loop_prop( 'loop', $loop_index );