Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Args
- $args = array(
- 'post_type' => 'product',
- 'posts_per_page' => 10,
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'tax_query' => $tax_query
- );
- $query = new WP_Query( $args );
- if( $query->have_posts() ) :
- woocommerce_product_loop_start();
- while( $query->have_posts() ): $query->the_post();
- wc_get_template_part( 'content', 'product' );
- endwhile;
- woocommerce_product_loop_end();
- // TODO - get pagination working
- woocommerce_pagination();
- wp_reset_postdata();
- else :
- echo '<p>No products found</p>';
- endif;
Add Comment
Please, Sign In to add comment