I’ve created a loop that gets events successfully.
The array I pass in to WP_Query looks like this:
$args = array(
‘post_type’ => ‘tribe_events’,
) ;
So far so good…
Now, I’ve added an Event Category called ‘featured’. I’d like my loop to just get “featured events”.
I figure that Event Categories are custom taxonomies. So I tried this:
$args = array(
‘post_type’ => ‘tribe_events’,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘tribe_events_cat’,
‘field’ => ‘slug’,
‘terms’ => ‘featured’
)
)
) ;
Unfortunately, this query fails, and the loop returns no results.
So, what do I need to pass in to the loop arguments in order to get back events filtered by an Event Categories ?
Thanks