Created
April 17, 2013 15:00
-
-
Save renanlara/5405013 to your computer and use it in GitHub Desktop.
WooCommerce - Sample products loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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(); | |
woocommerce_get_template_part( 'content', 'product' ); | |
endwhile; | |
} else { | |
echo __( 'No products found' ); | |
} | |
?> | |
</ul><!--/.products--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment