WordPress Snippets at WPcustoms

Change number of WooCommerce products per row

Defines where ‘first’ and ‘last’ classes are applied in product archives


/**
 * Snippet Name: Change number of WooCommerce products per row
 * Snippet URL: http://www.wpcustoms.net/snippets/change-number-of-woocommerce-products-per-row/
 */
 // Change number or products per row to 3

if (!function_exists('loop_columns')) {
	function loop_columns() {
		return 3; // 3 products per row
	}
}
add_filter('loop_shop_columns', 'loop_columns');