Forums › Forums › Search & Filter Pro › Date range filter with Post meta
Tagged: acf, custom field, custom post type, date range, post meta
- This topic has 12 replies, 2 voices, and was last updated 4 years, 11 months ago by Trevor.
-
Anonymous(Private) January 27, 2020 at 7:09 pm #232226
Hi,
I’m building a website, that has events. I would like to make a search form, where users can select the from and to date, and the site lists the events that are in the date range that the user set.
I have the custom post type, called Events, and two custom date field (from date and to date), where I can set the event’s start date and end date in the admin.
I’ve satertd to build the search form, using the Date post element, and I have tried to set the Post meta condition, but honestly, I don’t know what to do with them.Could you help me please?
I have read your documentation, but I couldn’t find any steps about this.Thank you,
Anonymous(Private) January 27, 2020 at 8:52 pm #232236I’ve just solved it, but I have an other problem, the two meta field have an AND relationship, bit I would like to set it to OR. I have changed the Field relationships to OR, but it does not work. When I search I got nothing found message 🙁 It shows the results only if I set the correct date for all the date fields.
Please help me,
Thank youAnonymous(Private) January 27, 2020 at 9:30 pm #232238One more very important thing: If I set the event start date to 2020. jan 1. and the end date 2020. feb 4., and the user in the search field set the 2020. jan 12. start date and 2020. jan 18 end date, she/he has to get the event mentioned above.
How can I set this?
Thank you,
Trevor(Private) January 28, 2020 at 11:32 am #232283Please see this screenshot:
https://www.screencast.com/t/bo3sHgiou
Is that what you want?
Did you try this:
Anonymous(Private) January 28, 2020 at 12:00 pm #232300I’ve just tries it, but still not working. It only shows the results if I set the start date or the end date to the event’s atart date or and date. My event starts at 2020 jan 29 and ends at 2020 feb 5, but when the user search like this: start date: 2020 jan 30, end date: 2020 feb 3, the event does not show up.
-
AuthorPosts