- This topic has 4 replies, 2 voices, and was last updated 5 years, 3 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Filter by year with date string from ACF
Tagged: results date
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.
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
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?