Skip to content

Instantly share code, notes, and snippets.

@digiltd
Created June 17, 2014 05:23
Show Gist options
  • Save digiltd/446ad8972b65b7f69e19 to your computer and use it in GitHub Desktop.
Save digiltd/446ad8972b65b7f69e19 to your computer and use it in GitHub Desktop.
woocommerce list / loop products
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 999
);
$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' );
}
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment