Plugin wont Filter custom shop page
-
Hello there
I have installed Annasta Filters and it work perfectly on shop page, but when i make a custom query to this page to show products by Tags, the plugin wont work,
this is the code that i’m using<?php $args = array( 'number' => $number, 'orderby' => 'title', 'order' => 'ASC', 'hide_empty' => $hide_empty, 'include' => $ids ); $product_tags = get_terms( 'product_tag', $args ); $count = count($product_tags); if ( $count > 0 ){ foreach ( $product_tags as $product_tag ) { echo '<h4>' . $product_tag->name . '</a></h4>'; $args = array( 'posts_per_page' => -1, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'product_tag', 'field' => 'slug', // 'terms' => 'white-wines' 'terms' => $product_tag->slug, 'product_tag'=> "latest-product" ) ), 'post_type' => 'product', 'orderby' => 'title,' ); $products = new WP_Query( $args ); woocommerce_product_loop_start(); while ( $products->have_posts() ) { $products->the_post(); do_action( 'woocommerce_shop_loop' ); wc_get_template_part( 'content', 'product' ); ?> <?php } woocommerce_product_loop_end(); } } ?>and this is the display

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Plugin wont Filter custom shop page’ is closed to new replies.