Category attribute not working in custom shortcode

So I see two things that could contribute to the problem:

  1. I really doubt you’ll need to esc_attr for the query.
  2. 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!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)