Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Filtering using event dates
This topic contains 17 replies, has 2 voices, and was last updated by Ernest Marcinko 4 years, 5 months ago.
- AuthorPosts
- October 21, 2019 at 10:13 am #24380
I was wondering if you could give me advice on setting up a filter to search through event dates. I have created a custom post called Whats-on which have event dates. Some dates or single dates “21 October 2019” and some dates are dates from “21 October 2019 – 25 October 2019”
What would be the best approach to do this? Which events plugin would you recommend? I installed The Events Calendar plugin but I can’t get the filter to work, keeps saying no results.
October 21, 2019 at 4:24 pm #24388Hi,
I am not sure if The Events calendar plugin supports adding date fields to custom post types. I can recommend that plugin and the Events Manager plugin, but you may need to ask the authors of those if they support adding date custom fields to your custom post type.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 21, 2019 at 4:33 pm #24389Could you point me to the correct Events Manager plugin you mean? Is it this one https://wp-eventmanager.com/?
October 22, 2019 at 9:08 am #24393Sure! It’s this one: https://hu.wordpress.org/plugins/events-manager/
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 22, 2019 at 10:27 am #24396Thank you.
1 more question, is there a way to date filter by current week and by current month? If it is a Thursday and I have a checkbox to search by current week, could it search till Sunday?
October 22, 2019 at 12:32 pm #24398Hi,
Unfortunately no, that is not possible. As far as I know the dates are stored within a single date field, and the plugin can only compare the values from a datepicker against that.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 8, 2019 at 12:04 am #24565Hi Ernest,
I’m having trouble with filtering dates using a start and end date.
I created a custom post type for events (whats on) and 2 custom fields with Advanced custom fields, start date (whats_on_date_start_date) and end date (whats_on_date_end_date)
The filter I created works great when the start and end date are the same. Example the event date is 14th November 2019 – start date 14th November / end date 14th November. But some events last more than 1 day – Example 1st November to 30th November. The custom field doesn’t pick these up.
Could you tell me what the issue might be and if this is possible?
Thank you
Attachments:
You must be logged in to view attached files.November 8, 2019 at 10:26 am #24577Hi!
Well, it should work, based on your description, if everything is set up correctly. The from-date filter there seems to be okay, so I suspect the other one is the problem.
Make sure that the correct custom field, and the correct operator is selected. (‘..before the date (to date) inclusive’) – if the operator is set incorrectly, that would explain the issue perfectly, as it will still show the one day events.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 8, 2019 at 10:44 am #24580You cannot access this content.November 8, 2019 at 10:46 am #24582You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 8, 2019 at 10:54 am #24583You cannot access this content.November 8, 2019 at 12:46 pm #24584You cannot access this content.November 8, 2019 at 2:44 pm #24587Thank you, that is working now, not sure what the issue was.
I just re-read your previous comment. I see the issue now. You have:
– Event set as: 12 September 2019 till 9th feb 2020
– Filter set as: 1st november 2019 till 20th november 2019That will not match of course, since 1st Nov. is > 12 Sept, same for the end thate. The filter is basically saying “show me events that start after 1st Nov and end before 20th november” – and none of that match that event. The event is basically out of the interval
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 8, 2019 at 2:54 pm #24588Hi Ernest,
Is this not possible to do then?
Do you know a solution?I guess you understand what I am trying to achieve here. That event does fall on November so I was hoping it would show.
November 8, 2019 at 2:59 pm #24589Hi,
I am not sure what exactly you are looking for, maybe the reverse of the filter operators?
Best,
Because this right now works correctly, it does exactly what it should. If you flip the operators for the start/end dates, then it will show basically all ongoing events.
..or you can change the filed logic to OR, and then it will show events that either start after the date, or end before the date.
I recommend experimenting with these, one configuration will give you the expected results, I am sure.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.