Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( is_post_type_archive() and ! is_search() ) {
- echo do_shortcode('[recent_products per_page="60"]');
- }
- else if( is_search() or is_tax('product_tag') ) {
- if ( have_posts() ) :
- woocommerce_product_loop_start();
- woocommerce_product_subcategories();
- while ( have_posts() ) : the_post();
- wc_get_template_part( 'content', 'product' );
- endwhile; // end of the loop.
- woocommerce_product_loop_end();
- elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) :
- wc_get_template( 'loop/no-products-found.php' );
- endif;
- } else {
- $queried_object = get_queried_object();
- $termSlug = $queried_object->slug;
- echo do_shortcode('[product_category category="'.$termSlug.'"]');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement