Home › Forums › ACF PRO › Order CPT by Date Picker then by Time Picker › Reply To: Order CPT by Date Picker then by Time Picker
My updated 2nd query and it still does not order the posts right. With this second query I need the posts to be ordered by time. The meta_query shows posts that match the date and then it should order them by start_time
$date_query = new WP_Query(array(
'post_type' =>'sessions',
'posts_per_page' => -1,
'meta_query' => array(
'date_clause' => array(
'key' => 'session_date',
'compare' => '=',
'value' => $dayKey,
'type' => 'date'
),
'time_clause' => array(
'key' => 'start_time',
'compare' => 'EXISTS',
),
),
'orderby' => array(
'time_clause' => 'ASC',
),
)); ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.