This query was working fine, but now i’m having a trouble with it since i’ve switched to multisite. I’ve added “global $switched” and “switch_to_blog(4)”, and it works fine when i remove the “tax_query” argument!
but when i add it back it returns no results.
global $switched;
switch_to_blog(4);
$args = array(
'post_type' => 'grille',
'posts_per_page' => 1,
'no_found_rows' => true,
'meta_key' => 'heure_debut',
'orderby' => 'meta_value',
'order' => 'DESC',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'type_du_programme',
'value' => 'emission',
'compare' => '='
),
array(
'key' => 'heure_debut',
'value' => $current_time,
'compare' => '<'
)
),
'tax_query' => array(
array(
'taxonomy' => 'jours_de_diffusion',
'field' => 'slug',
'terms' => $current_day
)
)
);
$loop = new WP_Query( $args );