Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Upcoming events not showing up
This topic contains 8 replies, has 2 voices, and was last updated by Ernest Marcinko 3 years, 9 months ago.
- AuthorPosts
- August 27, 2019 at 10:52 am #23744
Hi guys,
We are using Ajax Search pro with Events Manager to filter out events based on category, tags, and start date.
We have normal events as well as recurring events. The filtering by category and tags work perfectly, but we are having trouble with making the search plugin work correctly in showing upcoming events.Here are the instances that we have problems on:
1. In https://lmg.alexandermarketing.co.uk/temple-newsam/whats-on-at-temple-newsam/, we wanted to show upcoming events but on page load not all the events are being shown. We use [wd_asp id=4] for that page.
2. The date filter should show events happening on or after the date entered. The future events weren’t being shown if you search for a date that is not in the range of the event’s from-date and to-date. For example if you search Aug 26,2019, events that starts at Aug 25, 2019 will not show up.The summary of what we want to achieve is on page load, all upcoming events should show up and searching a date would return events happening on and after the searched date.
We have a live site are we’re trying to fix it on the dev site first. Please could you guide us on setting up the correct settings and in making the plugin work for our client. Your help is greatly appreciated.
Regards,
David AlexanderAugust 27, 2019 at 2:03 pm #23757Hi David,
Currently I am only seeing one filter on the ‘_event_start’ custom field. If I was to enter the date “aug 26” there, then events starting before that date will be filtered out.
Best,
If you want the ongoing events to show, then maybe using a filter on ‘_event_end’ would be more useful.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 27, 2019 at 7:20 pm #23778Hello Ernest,
We use ‘_event_start’ to show results ‘..after the date (from date) inclusive’.
I tried using ‘_event_end’ as per your suggestion using with every combination of the datepicker operation (before the date, after the date, etc). But on page load it doesn’t show the upcoming events and on input of a date to filter it doesn’t show correct events which are events within the date range and events happening after the inputted date.Regards,
David AlexanderAugust 28, 2019 at 11:03 am #23800Hi David,
Is the ‘_event_end’ set of those events?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 28, 2019 at 1:07 pm #23812Hi Ernest,
Yes, _event_end is set for all events including the recurrences.
August 29, 2019 at 9:01 am #23829Thanks.
Okay, I just remembered that there was already a custom code implemented for a request you had before, I believe it was something to do with events that start before/after a specific timeframe around a date, when the page is first loaded.
Best,
I added a small bypass there, to not activate that code on this specific search instance. I am not sure if the results are as expected, but I am seeing results after the given date now as defined in the filter.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 29, 2019 at 10:39 am #23842Hi Ernest.
I have rescheduled the recurring events to refresh the recurrence – some of the recurrences occur in year 1970. And after doing this, these events are now showing up on the page.
But it didn’t display the event https://lmg.alexandermarketing.co.uk/events/fantastical-beasts/ which is dated on 30/03/2019 – 03/11/2019. I think this is because the custom post type used is ‘_event_start’. Is there a way to check the inputted date if it is between the ‘_event_start’ and ‘_event_end’?Thank you, it’s getting there!
August 29, 2019 at 11:46 am #23844Also, is there a way to show all upcoming events. The plugin doesn’t show events having the same title.
Thank you!
August 30, 2019 at 10:04 am #23873Hi,
I’m afraid that is only possible via additional custom coding, but I am not sure if I can do that, as there was already lots of custom coding made, and it will very likely conflict one with the other.
The duplicate name filter is also a custom code, that you requested earlier, by default the plugin does not do that. You can remove that custom code, it is on the lines 228-243 in your child theme functions.php file:
Best,add_filter('asp_results', 'asp_filter_duplicate_titles'); function asp_filter_duplicate_titles($results) { $titles_arr = array(); foreach($results as $k=>&$r){ if ( isset($r->post_type) ) { if ( $r->title != '' ) { if ( in_array($r->title, $titles_arr) ) { unset($results[$k]); } else { $titles_arr[] = $r->title; } } } } return $results; }
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.