Query won't sort according to ACF date picker field

Description:

I’ve set up a query and it will only sort by Wordpress-field Date Published, instead of the selected ACF custom field Event Date (Jquery Date Picker).

Step-by-step reproduction instructions:

  1. create custom post type (e.g. ‘Events’) with CPT UI plugin
  2. create custom ACF field Jquery date picker for that post type (e.g. ‘Event Date’)
  3. create blog in Gutenberg Editor, insert Query
  4. in the ‘Order’ field, click on sort by ACF > custom field group > your custom date Jquery
  5. it won’t change the order; it will keep sorting on Wordpress Publish Date
  • WordPress version: 5.9.3
  • Gutenberg Plugin version: -
  • Cwicly Plugin version: 1.1.4
  • Cwicly Theme version: 1.0.3

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,

2 Likes

It works! thank you so much. I’ll copy your reply to my other post so that people can see it

2 Likes