Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herrherrmann/75e7277407caa94639fb to your computer and use it in GitHub Desktop.
Save herrherrmann/75e7277407caa94639fb to your computer and use it in GitHub Desktop.
/*
* Querying all tribe (The Events Calendar Pro) events…
* - with a certain category (e.g. 'course')
* - starting today or later
*/
$events = get_posts( array(
'post_type' => 'tribe_events',
'posts_per_page' => 20,
'tax_query' => array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => 'course'
)
),
'meta_key' => '_EventEndDate',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => '_EventEndDate',
'value' => date('Y-m-d'),
'compare' => '>=',
'type' => 'DATETIME'
)
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment