Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Category A
- Category A1
- Category A2
- Category A3
- if ( have_posts() ) {
- do_action( 'woocommerce_before_shop_loop' );
- woocommerce_product_loop_start();
- if ( wc_get_loop_prop( 'total' ) ) {
- while ( have_posts() ) {
- the_post();
- // here I filter the products from specific category
- global $post;
- $skip = false;
- $terms = wp_get_post_terms( $post->ID, 'product_cat' );
- foreach ( $terms as $term ) {
- if(substr( $term->slug, 0, 7 ) === "zubehor") {
- $skip = true;
- break;
- }
- }
- if($skip)
- continue;
- do_action( 'woocommerce_shop_loop' );
- wc_get_template_part( 'content', 'product' );
- }
- }
- woocommerce_product_loop_end();
- do_action( 'woocommerce_after_shop_loop' );
- }
Add Comment
Please, Sign In to add comment