Home › Forums › General Issues › wp_query how to order events by date then time › Reply To: wp_query how to order events by date then time
I can see in a forum post below that using clauses might be the way forward but as you can see from the below example
'meta_query' => array(
'relation' => 'AND',
'date_clause' => array(
'key' => 'event_date',
'compare' => '=',
),
'time_clause' => array(
'key' => 'event_time',
'compare' => '=',
),
),
'orderby' => array(
'date_clause' => 'ASC',
'time_clause' => 'ASC',
),
Which I’ve borrowed from that post is that my needs include an OR relation for start and end date (end date like start and end time are also optional) so can a clause include an OR relation inside of it or is there a different way to solve this?
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.