Home › Forums › Calendar Products › Events Calendar PRO › Change search bar to search past events
- This topic has 9 replies, 4 voices, and was last updated 7 years, 6 months ago by FreshySites.
-
AuthorPosts
-
September 30, 2016 at 7:10 am #1170976FreshySitesParticipant
I have a page set to show past events. The search bar doesn’t appear to be working though. I think it could be excluding past events from being searched. Do you have advice for how to get the search bar to search both past and present events?
Thanks in advance.
October 1, 2016 at 10:11 am #1171516CliffMemberHi Benjamin.
Thanks for your question.
I believe the code that sets the Tribe Bar’s search parameters is here: https://github.com/moderntribe/the-events-calendar/blob/4.2.7/src/Tribe/Main.php#L4147-L4184
You could probably use the tribe-events-bar-date-search-default-value filter to something like “today minus 30 days” or whatever you want there.
Please let me know if you have follow-up questions on this topic.
October 3, 2016 at 5:27 am #1171750FreshySitesParticipantCan you suggest what to add to the code that would include ALL events, no matter the date? Also where should this be placed in the code?
October 4, 2016 at 11:12 am #1172418CliffMemberBenjamin, I did some testing, and our List View already includes past events if the “Date From” field is left blank.
So I tried with one of our developers to create a snippet to redirect all Tribe Bar searches to List View, but it didn’t come out cleanly.
Other ideas were to implement a custom search view or something like a custom page with a shortcode that handles it all. Or perhaps redirecting all Tribe Bar searches to the default WordPress search results page, like ?s=keyword&post_type=tribe_events
Unfortunately, none of these are quick and easy implementations. If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.
October 4, 2016 at 1:08 pm #1172447FreshySitesParticipantI have the page already set to list view, you can test it out here : http://safehealthcare.wpengine.com/events/list/?tribe_paged=1&tribe_event_display=past&tribe_eventcategory=57
Can you specify why the search bar isn’t functioning correctly?
October 5, 2016 at 10:54 am #1172840CliffMemberBenjamin, thanks for the link.
Ah ha!
In List View, if you search for something that matches an Upcoming Event, it will also let you navigate the matches in the Past.
However, if there are no matches for Upcoming Events, Past Event matches won’t be included either, which makes the result look like:
There were no results found for “YOUR SEARCH TERM”.
I believe this is what you’re experiencing on your site.
Please confirm this by creating a test event with “Health” in the title. Currently, http://safehealthcare.wpengine.com/events/list/?tribe_paged=1&tribe_event_display=list&tribe-bar-search=health returns no results even though there is a past event it should match.
Now does it match both the past and current “health” events?
October 5, 2016 at 1:23 pm #1172927FreshySitesParticipantI don’t think it is showing past events at all. Here are my results : http://prntscr.com/cqa8vh
It only shows the one event which has a future date.
October 5, 2016 at 2:57 pm #1172970CliffMemberRight… now click “Previous Events” link in the lower-left of that single result and they should be there.
I asked one of our developers about this and they didn’t think there was any “snippet-able” way to help this “feature” (or problem in your case).
You could request this as a new feature/enhancement (or maybe search to see if the idea was already posted by someone else) at our plugins’ UserVoice page.
This allows others who are interested in that feature to easily voice their support. We frequently review suggestions there to find out which ones are popular, then we implement as many of them as we can.
If you post it / find it, feel free to link to it from here in case anyone comes across this forum thread in the future.
October 27, 2016 at 9:35 am #1183839Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Change search bar to search past events’ is closed to new replies.