Sorting on ACF date field

Hi,

I’ve seen this covered elsewhere but still can’t work it out. My results aren’t in a proper date order. Here’s the query string:

post_type=hps-event&orderby=meta_value&meta_key=hps_start_date&order=DESC

And here’s the output

The return format from the ACF field is: Ymd G:i

Somehow 20230625 (25th June 2023) is sorting earlier than 20231001 (1st of October)

Any genius ideas?

Thanks, Bill.

Hey Bill,

Thanks for reaching out!

The given query string will work as it should. There could be another issue why it is behaving that way. That being said, would you mind sharing your admin credentials so that we can check on it properly? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin-level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Hello @bill_hodgson,

The Looper Provider Query String is correct. The issue is the value of the meta key. Check out these two:

You will have to edit those events that do not have the same Date format and value.

Kindly let us know how it goes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.