WordPress tax_query “and” operator not functioning as desired

not tested but give this a shot

'tax_query' => array(
   'relation' => 'AND',
    array(
      'taxonomy' => 'image_tag',
      'field'    => 'term_id',
      'terms'    => 25,
      'operator' => 'IN',
    ),
    array(
      'taxonomy' => 'image_tag',
      'field'    => 'term_id',
      'terms'    => 41,
      'operator' => 'IN',
    )
  ),

OR

'tax_query' => array(
   'relation' => 'AND',
    array(
      'taxonomy' => 'image_tag',
      'field'    => 'term_id',
      'terms'    => array(25,41),
      'operator' => 'IN',
    ),
  ),

Leave a Comment

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