carasmo
10/11/2017 - 2:12 PM

Change Loop in WooCommerce for CSS Grid or not floats : This is to be included as a separate file in your theme. If you do it differently, b

Change Loop in WooCommerce for CSS Grid or not floats : This is to be included as a separate file in your theme. If you do it differently, be sure to check that WooCommerce is installed,

<?php
/**
 * Theme Name
 *
 * Adds the required WooCommerce setup functions to the Theme Name
 *
 * @package       Your Package
 * @author        Your Name
 * @license       GPLv3 or later
 * @license uri   https://www.gnu.org/licenses/gpl-3.0.en.html
 * @version       1.0.0
 */
 
 
if( ! defined( 'ABSPATH' ) ) exit;


add_theme_support( 'woocommerce' ); 
add_theme_support( 'genesis-connect-woocommerce' ); 


//* Check for WooCommerce, exit if not active
if ( ! class_exists( 'WooCommerce' ) ) return;



/** 
 * Add Custom WooCommerce Loop Start
 */
function woocommerce_product_loop_start( $echo = true ) {
	ob_start();
	echo '<ul class="woo-products">'; 
	if ( $echo ):
		echo ob_get_clean();
	else:
		return ob_get_clean();
	endif;
}


/** 
 * Add Custom WooCommerce Loop End
 */
function woocommerce_product_loop_end( $echo = true ) {
	ob_start();
	echo '</ul>'; 
	if ( $echo ) :
		echo ob_get_clean();
	else:
		return ob_get_clean();
	endif;	
}