Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. if( is_post_type_archive() and ! is_search() ) {
  2. echo do_shortcode('[recent_products per_page="60"]');
  3. }
  4. else if( is_search() or is_tax('product_tag') ) {
  5. if ( have_posts() ) :
  6. woocommerce_product_loop_start();
  7. woocommerce_product_subcategories();
  8. while ( have_posts() ) : the_post();
  9. wc_get_template_part( 'content', 'product' );
  10.  
  11. endwhile; // end of the loop.
  12.  
  13. woocommerce_product_loop_end();
  14. elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) :
  15. wc_get_template( 'loop/no-products-found.php' );
  16. endif;
  17. } else {
  18. $queried_object = get_queried_object();
  19. $termSlug = $queried_object->slug;
  20. echo do_shortcode('[product_category category="'.$termSlug.'"]');
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement