I feel like I'm extremely close on this one but the query keeps on showing up empty. Basically, I'm trying to query the custom values between two dates. Records should be returned if the start date is less than the current date and the end date is greater than or equal to the current date:
$args = array(
'taxonomy' => 'exhibition_type',
'term' => 'faculty',
'numberposts' => 10,
'post_type' => 'exhibitions',
'meta_key' => 'start_date_of_event',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'start_date_of_event',
'value' => $current,
'compare' => '<'
),
array(
'key' => 'end_event_date',
'value' => $current,
'compare' => '>='
)
),
'order_by' => 'meta_value_num',
'order' => 'ASC',
'paged' => $paged
);
The code I'm using now keeps on turning up 0 results and I'm stuck at the moment. Any help would be much appreciated.
'meta_key' => 'start_date_of_event'
and the'order_by' => 'meta_value_num'
and tell me if it's working then.$current
takes?BETWEEN
instead of 2 conditions?