Skip to content

Instantly share code, notes, and snippets.

@stoffl6781
Created November 2, 2022 13:50
Show Gist options
  • Save stoffl6781/bb55a6e80571af05c9201151ce477782 to your computer and use it in GitHub Desktop.
Save stoffl6781/bb55a6e80571af05c9201151ce477782 to your computer and use it in GitHub Desktop.
$args = array(
'post_type' => 'event',
'meta_query' => array(
'relation' => 'AND',
'event_start_date_clause' => array(
'key' => '_event_start_date',
'compare' => 'EXISTS',
),
'event_start_time_clause' => array(
'key' => '_event_start_time',
'compare' => 'EXISTS',
),
),
'orderby' => array(
'event_start_date_clause' => 'ASC',
'event_start_time_clause' => 'ASC',
),
);
$loop = new WP_Query( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment