I've been wrestling with this problem for a while now and cannot figure it out.
I am using the meta query to get upcoming events within my custom theme. The code being used is thus;
$args = array( 'post_type' => 'event', 'posts_per_page' => 10, 'meta_query' => array( array( 'key' => 'event_start_date', 'value' => date('Ymd'), 'compare' => '>=', 'type' => 'DATE' )), 'orderby' => 'event_start_date', 'order' => 'DESC' ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post();
If i remove the meta_query portion, the query runs fine and orders the events by start date (just shows past events also).
The query based currently as above returns no results whatsoever.
Can anybody see where ive gone wrong?