• Resolved pbritten

    (@pbritten)


    Is it possible to order by a ACF custom date field using AQL? I’ve entered the following parameters in the AQL block with no success:

    Order by: Meta Value (also tried Meta Value Num)

    Ascending order is true.

    Meta key: date_of_event (Note: the value for this field is stored in Ymd format)

    Meta value: (empty)

    Would you be so kind as to tell me what I’m doing wrong?

    Thank you for your help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ryan Welcher

    (@welcher)

    From what you’ve described, that should work. I set up a quick test and was able to sort posts by the date.

    This what my settings look like:

    • This reply was modified 1 year, 3 months ago by Ryan Welcher.
    • This reply was modified 1 year, 3 months ago by Ryan Welcher.
    Thread Starter pbritten

    (@pbritten)

    Thank you for your quick reply!

    The value you entered in the Meta Key field has a gray background with an X. The value I enter in the AQL has no such background. Is it possible that AQL doesn’t recognize the key name? I registered the custom key in the functions.php of the theme, but I did not add them to a JSON file. Does AQL need JSON to see the meta keys?

    Thank you again for your time!

    • This reply was modified 1 year, 3 months ago by pbritten.
    • This reply was modified 1 year, 3 months ago by pbritten.
    Plugin Author Ryan Welcher

    (@welcher)

    After manually adding your key, be sure to press the return key. That might be the issue!

    Thread Starter pbritten

    (@pbritten)

    Good sir, that did the trick!

    Thank you so much for being there, for helping me, and for creating a wonderful and much-needed plugin!

    All the best,

    Pat

    Plugin Author Ryan Welcher

    (@welcher)

    Awesome! Clearly I need some better UI to make this less confusing. Thanks for sticking with me while we got this sorted out!

    How do you get this Post Meta Query section?

    I do not have that in AQL Block configuration. When I change sort to Meta Field I see notification “Meta Value and Meta Value Num require that Meta Key is set in the Meta Query section.”, but there is no Meta Query section.

    Hmmm, I found out that I have to turn off “Inherit query from template” to get “Meta Query section” visible, but I cannot to that as I am customizing sort for specific Category. If I turn it off then I loose Category information.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Order by ACF custom date field’ is closed to new replies.