Order by date in query not working

I’ve got a query set up and I’m ordering by date (through an ACF date field), but when you check the page it doesn’t actually sort correctly according to date.

For example there’s one event in 2022 showing after the first 2023 event shows.

What could be going wrong?

Web page:
borisbishop.com/agenda

I feel like somehow it just keeps sorting based on Wordpress published date, instead of the necessary ACF-field Event Date (that I created)

I reported the above as bug and got the following reply from Louis that solved everything:

" Hi @boris,

Thanks for the report.

To sort with an ACF Date field, you don’t have to use the dynamic selector.
You’ll want to order by a Numeric Meta Value and set the Meta Key field to the name of your ACF field.
I also always set my Date field return to: YYYYMMDD

Let me know if that helps.

Cheers,"

1 Like