I'm trying to sort custom post type made with ACF plugin by most current date. Ideally future most current post should be first. Currently, I'm sorting by date, which gives me the earliest post as the first post.
Here is my code.
$loop = new WP_Query( array( 'post_type' => 'events', 'posts_per_page' => -1, 'meta_key' => get_sub_field( 'date_start' ), 'orderby' => 'meta_value_num', 'order' => 'ASC' ) );
I have tried this post to no avail https://stackoverflow.com/questions/28951370/sort-wp-query-by-acf-datepicker
It seams that my
meta_query is not properly setup.
This is the
meta_query that I tried.
'meta_query' => array( array( 'key' => get_sub_field( 'date_start' ), 'compare' => '>=', 'value' => current_time('Ymd'), ) ),
note: for some reason I have to do
'date_start' doesn't return any results.