“tax_query” parameter not working with WP_Query

The tax_query parameter is an array of arrays, not just an array.

This:

'tax_query' => array(
        'taxonomy' => 'video_type',
        'terms' => 'episode',
        'field' => 'slug',
        'include_children' => true,
        'operator' => 'IN'
),

Should instead be this:

'tax_query' => array(
    array(
        'taxonomy' => 'video_type',
        'terms' => 'episode',
        'field' => 'slug',
        'include_children' => true,
        'operator' => 'IN'
    )
),

Leave a Comment