tax_query not working?

tax_query is not working, inside the eachloop I’m trying to echo $use_case_category->slug; and getting all the taxonomies on the screen and not the ones selected by bootstrap tabs. All the rest of the code works fine, but when it comes to filtering the posts by taxonomies by clicking on the tabs, it’s not working. The code:

foreach($use_case_categories as $use_case_category) {
//$out .= ‘slug.’ “>’;

$args = array(
‘post_type’ => ‘use_cases’,
‘posts_per_page’ => 11,
‘orderby’ => ‘title’,
‘order’ => ‘ASC’,
‘tax_query’ => array(
‘taxonomy’ => ‘type’,
‘field’ => ‘slug’,
‘terms’ => $use_case_category->slug,
‘include_children’ => true,
‘operator’ => ‘IN’

$films = new WP_Query( $args );

if ( $films->have_posts() ) :
while ( $films->have_posts() ) : $films->the_post();

echo $use_case_category->slug;

Read more here:: tax_query not working?

Leave a Reply

Your email address will not be published. Required fields are marked *