Advertisement
Guest User

Untitled

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