Default Search Range

Home Forums Calendar Products Community Events Default Search Range

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1094231
    Iain Bluett
    Participant

    Is it possible to search “all” events, rather than only events “this month”? For example, if you search my site for “taco” it responds with “There were no results found for “taco” this month. Try searching next month.” –

    Can I change the default search settings so that it searches all future events?

    Thanks,

    #1094739
    Nico
    Member

    Howdy Ianin,

    Welcome to our support forums and thanks for reaching out to us. I’ll help you here…

    Per default each event view searches for events in it’s scope, so Month view searches events on the displayed month, Week view on the displayed week and Day view does the same on the current day. List View search will include all upcoming events. At the time there is no setting to modify this.

    What you can do is modify the search query parameters to alter the results. In that case I can point you in the right direction but you’ll need to write some custom code.

    Please let me know what you think about it,
    Best,
    Nico

    #1094740
    Iain Bluett
    Participant

    This reply is private.

    #1094746
    Nico
    Member

    Good to hear!

    Here’s a basic snippet to inspect / alter the query parameters…


    function filter_search_query ( $query ) {
    if ( ! empty( $_REQUEST['tribe-bar-search'] ) ) {
    //print_r($query);
    }

    return $query;
    }

    add_filter( 'tribe_events_pre_get_posts', 'filter_search_query');

    If you uncomment the print_r line, you’ll get a dump of the query parameters. To view this use the browser console network tab and inspect the ajax call for search.

    Please let me know if you follow,
    Best,
    Nico

    #1101404
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Default Search Range’ is closed to new replies.