Change search bar to search past events

Home Forums Calendar Products Events Calendar PRO Change search bar to search past events

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1170976
    FreshySites
    Participant

    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.

    #1171516
    Cliff
    Member

    Hi 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.

    #1171750
    FreshySites
    Participant

    Can 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?

    #1172418
    Cliff
    Member

    Benjamin, 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.

    #1172447
    FreshySites
    Participant

    I 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?

    #1172840
    Cliff
    Member

    Benjamin, 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?

    #1172927
    FreshySites
    Participant

    I 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.

    #1172970
    Cliff
    Member

    Right… 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.

    #1183839
    Support Droid
    Keymaster

    Hey 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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Change search bar to search past events’ is closed to new replies.