';
echo '
';
}
}
// product opening tag
add_filter('woocommerce_before_shop_loop_item', 'kids_education_template_loop_product_open', 5 );
if ( ! function_exists( 'kids_education_template_loop_product_open' ) ) {
function kids_education_template_loop_product_open() {
echo '
';
}
}
// change position of add to cart button
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10);
// product closing tag
add_filter( 'woocommerce_before_shop_loop_item_title', 'kids_education_template_loop_product_close', 10 );
add_filter( 'woocommerce_after_shop_loop_item', 'kids_education_template_loop_product_close', 10 );
if ( ! function_exists( 'kids_education_template_loop_product_close' ) ) {
function kids_education_template_loop_product_close() {
echo '
';
}
}
add_filter( 'woocommerce_output_related_products_args', 'kids_education_related_products_args' );
function kids_education_related_products_args( $args ) {
$args['posts_per_page'] = 3; // 4 related products
$args['columns'] = 3; // arranged in 2 columns
return $args;
}
// add excerpt
add_filter( 'woocommerce_after_shop_loop_item_title', 'kids_education_excerpt', 5 );
function kids_education_excerpt() {
echo '
'. kids_education_trim_content( 20 ) .'
';
}
// pagination
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 );
add_action( 'woocommerce_after_shop_loop', 'kids_education_wc_pagination', 10 );
function kids_education_wc_pagination() {
global $wp_query;
if ( $wp_query->max_num_pages <= 1 ) {
return;
}
?>