I'm working on a site that lists events. Right now this query lists events by date:
$args = array( 'post_type' => 'espresso_event', 'post_status' => 'publish', 'posts_per_page' => 8, 'category_name' => 'homepage', 'meta_key' => 'event_start_date', 'meta_query' => array( array( 'key' => 'event_start_date', 'value' => date('Y-m-d'), 'compare' => '>=', // compares the event_start_date against today's date so we only display events that haven't happened yet 'type' => 'DATE' ) ), 'orderby' => 'meta_value', 'order' => 'ASC' ); $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query($args);
However, some events take place on the same date at different times and I need it to order posts first by date and then by a custom meta called event_start_time. Problem is, I'm at a loss on how to do that. wp_query doesn't seem capable of ordering by two custom meta.
Is this something I can even do?