I am trying to use a custom query to retrieve set of events (custom post type) that are happening either today or in the future.
I have a custom field that I’m using (stored as ‘yyyymmddhhmm’ for sorting but the meta_query doesn’t seem to be working. Would anyone be able to tell me where I am going wrong?
$query_args = array(
'post_type' => 'events',
'meta_key' => 'start_sort_timestamp',
'meta_query' => array(
array(
'meta_key' => 'start_sort_timestamp',
'meta_value' => 201203051100,
'compare' => '>=',
'type' => 'NUMERIC'
)
),
'orderby' => 'meta_value',
'order' => 'ASC'
);
$query = new WP_Query( $query_args );