Wp Query Sort By Meta Date

$args = array(
 'numberposts' => 2,
 'meta_query' => array(
 array(
 'key' => 'event_date', // I've set this variable according to your examples
 'value' => date("Y-m-d"),
 'type' => 'DATE',
 'compare' => '>=' // Or > if strictly bigger dates are required
 )
 )
);

// get results
$the_query = new WP_Query( $args );

Leave a Comment