Ordering posts having multiple post-meta date fields
1) Using only the posts_orderby filter: It looks like you want to order the movies by the minimum of the wpcf-showtime meta values. You can modify the ORDER BY part of the SQL generated by the WP_Query, by using the posts_orderby filter. Here’s an example: add_filter( ‘posts_orderby’, ‘wpse_posts_orderby’ ); $ongoing_movies = new WP_Query( $args ); … Read more