WP Query filter not working
-
I have made a category filter for a custom post type, via an ajax request. The ajax is working, but I still receive all the result back. So basically, my query category filter is not working, and I would like to know why?
The proper category name is fetched correctly. I’ve logged it in the console. So it must be something with my wp query.
<?php $category = $_GET['category']; $args = array( 'post_type' => 'mixtapes', 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'tax_query' => array( 'taxonomy' => 'mixtapes_categorie', 'field' => 'slug', 'terms' => $category ) ); $mixtapes = new WP_Query($args); if ($mixtapes->have_posts()) : while ($mixtapes->have_posts()) : $mixtapes->the_post(); ?> <div class="col-md-6"> <?php the_content(); ?> </div> <? endwhile; endif; ?>
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WP Query filter not working’ is closed to new replies.