So I see two things that could contribute to the problem:
- I really doubt you’ll need to
esc_attr
for the query. - This is a tricky one, but tax_query needs to be an array of arrays
Based on this, I believe this will work better for you:
$tax_query = array(
'taxonomy' => 'resources_categories',
'field' => 'slug',
'terms' => array( $category ), // <--------
'operator' => 'IN',
);
$args = array(
'post_type' => 'resources',
'post_status' => 'publish',
'posts_per_page' => $per_page,
'orderby' => $orderby,
'order' => $order,
'tax_query' => array($tax_query) // <--------
);
Hope this helps!