Guest User

Untitled

a guest
Jun 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. // Args
  2. $args = array(
  3. 'post_type' => 'product',
  4. 'posts_per_page' => 10,
  5. 'orderby' => 'name',
  6. 'order' => 'ASC',
  7. 'tax_query' => $tax_query
  8. );
  9.  
  10. $query = new WP_Query( $args );
  11.  
  12. if( $query->have_posts() ) :
  13. woocommerce_product_loop_start();
  14. while( $query->have_posts() ): $query->the_post();
  15. wc_get_template_part( 'content', 'product' );
  16. endwhile;
  17. woocommerce_product_loop_end();
  18.  
  19. // TODO - get pagination working
  20. woocommerce_pagination();
  21.  
  22. wp_reset_postdata();
  23. else :
  24. echo '<p>No products found</p>';
  25. endif;
Add Comment
Please, Sign In to add comment