We're using custom posts to feature trip locations on our website which users can sign up for. Some of these trips have multiple dates, for instance, a trip may be going to Canada from May 4-15, June 25-30, etc. We want users to be able to filter the displayed trips by the date ranges that work for them. So, if a user wants to go on a trip during May, we want them to be able to filter the results down to only show trips that have viable dates during May. What would be the best way to accomplish this since each post can have multiple date ranges?
Hi,
Thank you for contacting us and I'd be happy to assist.
For a structure where the trips can have multiple instances, you can use the 'Repeating Field Group' feature:
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/
Your 'Trips' post type will have a repeating field group 'Trip Dates'. This repeating field group will have two date-type custom fields:
1). Trip Start Date
2). Trip End Date
When creating a search view for these trips, you'll select the repeating field group post type and not the 'Trips' post type.
I hope this helps and please let me know if you need further assistance.
regards,
Waqar