Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Filter by year with date string from ACF

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Patrick Leonberger
    #261915

    Hi there, I would like to use a date field from the WordPress Plugin Advanced Custom Fields in the search form UI. And I want to use only the “year” out of this date string to filter the results.
    At the moment the filter dropdown shows and uses the whole string with the format YYYYMMDD.

    Trevor Moderator
    #262052

    You would need a separate ‘Year’ field to filter by. You could make that an autosave value (each time an event/post is saved, WordPress would extract the year for you). The autosave idea is discussed in the post:

    https://support.searchandfilter.com/forums/topic/datefilter/page/3/#post-238869

    Patrick Leonberger
    #262321

    Thanks for your answer Trevor. I now have a separate ACF Field which stores only the year value. But when I try to use it as meta field filter, no options in the dropdown on the front end show up. I updated every article to regenerate the date in the new field. So there is content to use as filter options. Any idea what the problem could be?

    Patrick Leonberger
    #262327

    Solved it by myself. Thanks anyway!

    Trevor Moderator
    #262329

    Thanks for letting me know. I will close this thread for now.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Filter by year with date string from ACF’ is closed to new replies.