WP Query ordering on a meta field for posts with a date in the future not ordering by datetime
The docs are a little vague in this area, but it should be possible to define your ordering value more succinctly: $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 5, ‘category__in’ => $postCategories, ‘meta_query’ => array( array( ‘key’ => ‘ordering_date’, ‘value’ => date(“Y-m-d H:i:s”), ‘compare’ => ‘>=’, ‘type’ => ‘DATETIME’, ), ), … Read more