Sample products loop

Posted on

<ul class=”products”> <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 12 ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); wc_get_template_part( ‘content’, ‘product’ ); endwhile; } else { echo __( ‘No products found’ ); } wp_reset_postdata(); ?> </ul><!–/.products–>

Disable the default stylesheet

Posted on

You need to add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. Disable all stylesheets WooCommerce enqueues 3 stylesheets by default. You […]

Change number of products per row

Posted on

Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. Defines where ‘first’ and ‘last’ classes are applied in product archives. Please be aware […]

Change number of products displayed per page

Posted on

Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. Use the following code to change the number of WooCommerce products displayed per page. […]

Send coupons used in an order by email

Posted on

This snippet sends by email the list of coupons used in an order. You can customize the “$to” variable and define your own email address, and the “$message” to have your own text. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. […]

Allow shortcodes in product excerpts

Posted on

Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. /** * Allow shortcodes in product excerpts */ if (!function_exists(‘woocommerce_template_single_excerpt’)) { function woocommerce_template_single_excerpt( […]