Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php /* Template Name: Custom Shop */ ?>
  2.  
  3. <ul class="products">
  4. <?php
  5. $args = array(
  6. 'post_type' => 'product',
  7. 'posts_per_page' => 12
  8. );
  9. $loop = new WP_Query( $args );
  10. if ( $loop->have_posts() ) {
  11. while ( $loop->have_posts() ) : $loop->the_post();
  12. wc_get_template_part( 'content', 'product' );
  13. endwhile;
  14. } else {
  15. echo __( 'No products found' );
  16. }
  17. wp_reset_postdata();
  18. ?>
  19. </ul><!--/.products-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement