I have a custom content type (event), within that type I have a custom date field, with the name: 'date'. In my template I am running the WP_Query to return a list of events. I would like to only get events that are in the future (according to my custom 'date' field) and then order the list by that same field.
I have tried the following but it simply returns a list of all the 'events' in the system, regardless of date
$today = date('d M, y'); $args = array ( 'post_type' => 'event', 'meta_query' => array( array( 'key' => 'date', 'value' => $today, 'compare' => '>', 'type' => 'CHAR', ), ), 'meta_key' => 'date', 'orderby' => 'meta_value_num', 'order' => 'ASC' );
As a note: if I replace the type from 'CHAR' to 'DATE' I get no results returned...