Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2013 16:40
Show Gist options
  • Select an option

  • Save anonymous/7305387 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/7305387 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Nov 4, 2013.
    28 changes: 28 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    $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
    ),

    ),
    )
    );