How do I query posts and use the 'orderby' attribute to order posts in loop according to date 'meta_value'?
I am creating a website for a theatre company, and I am creating an index of all past, current, and future productions. I would like the index to 'orderby' the ending date of each production (ACF 'date' field type; 'ending_date'). Here is an example of my query: <?php $futureProd = array( 'post_type' => 'productions', 'posts_per_page' => -1, 'meta_key' => 'ending_date', 'orderby' => 'meta_value', 'order' => 'ASC', ); $slider_posts = new WP_Query($futureProd); $array_rev = array_reverse($slider_posts->posts); $slider_posts->posts = $array_rev; ?> Have also tried the following, adding the 'meta