• Resolved Pablostevens71

    (@pablostevens71)


    I’m working on a list of past trade shows. I use CPT and ACF custom field for the “start-date”.

    I’m using the LOOP and orderby=”start-date”.

    When I display the [field start-date] it outputs like:

    NV02-02-2010

    (which is why I think the sort order is all messed up)
    I set the ACF to output YMD so it should out 20101102 which should sort properly. I think it’s how the plugin (Custom content short codes) is parsing the date output.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • polarracing

    (@polarracing)

    try

    [loop type=mytype orderby=field key=start-date]
    ...
    [/loop]
    Thread Starter Pablostevens71

    (@pablostevens71)

    I got this to work. Thank you……

    acf_date=event_start_date orderby=event_start_date order=DESC

    event_start_date is my ACF, I also had to have it output Ymd format ie: 20210123

    This is similar, but I’m not getting any output:

    [loop type=issue field=publication value=mypub acf_date=publication_date orderby=publication_date order=ASC]
    <li>[field title-link]</li>
    [/loop]

    If I remove acf_date=publication_date, then I get output, but no ordering. Am I missing anything? The publication date is configured to output in the format Ymd (eg. 20220415)

    • This reply was modified 2 years, 7 months ago by iantresman.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Orderby an ACF Date Field doesn’t work’ is closed to new replies.