The first query gets the dates picked in the posts and the second query compares all posts to the dates and lists all of the post that have picked that date, for example:
July 10th, 2019
July 11th, 2019
That is what I need the code to do, but it is currently ordering it by published date/time.
I have added your code and it still does not work. Here is a link to my site and the page it is implemented on – https://www.cosmeticsurgeryforum.com/agenda/
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',
),
)); ?>
That just unordered my initial dates and still does not order the posts by time.
It is supposed to show up like:
Day 1
Event 1 – 7am
Event 2 – 8am
Event 3 – 9am
Day 2
Event 4 – 7am
Event 5 – 8am
Event 6 – 9am
Day 3
Event 7 – 7am
Event 8 – 8am
Event 9 – 9am
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.