Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2013 16:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7305387 to your computer and use it in GitHub Desktop.
Save anonymous/7305387 to your computer and use it in GitHub Desktop.
$today = date("Y-m-d"); //today's date in MySQL format without the time. Used to compare start date custom field in events.
$wp_query = new WP_Query(
array(
'post_type' => array('tribe_events'),
'meta_query' => array(
array(
'key' => '_EventStartDate',
'value' => $today,
'compare' => '>=',
)
),
'tax_query' => array(
'relation' => 'OR', /*without OR both conditions will be met */
array(
'taxonomy' => 'filters',
'field' => 'slug',
'terms' => $filtersarray
),
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => $filtersarray
),
),
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment