Help Desk

Modify "Near" field title in the Tribe location search bar

  • Posts: 9 Topics: 7
    | Permalink

    I’d like to modify the “Near” label on the location search bar so that it gives a little more instruction to our users on how to find a better match. City, State for example. Where do I edit the label?

    Also, is there a way to add custom search distances to the filter bar? Currently list default is 5 miles to 250 miles. I’d like to offer greater distances to say up to 500 miles.

    Posts: 4809 Topics: 3 Answers: 6
    | Permalink
    Correct Answer

    Howdy aabarnod,

    The relevant Filter is actually added by the PRO addon, oddly enough. Its Class can be found here: \events-calendar-pro\lib\TribeEventsFilter_GeoLoc.php

    On line 15 you will notice that it runs the distance labels and their values through the WP Filter ‘geoloc-values-for-filters’. Simply hook into that filter and return whatever values you want, and you should be rocking!

    Does that make sense? Will that work for you? Please let me know. Cheers!

    – Brook

    Posts: 4809 Topics: 3 Answers: 6
    | Permalink

    I forgot to answer your first question. Whoops!

    You can modify any text string in our plugin, and even most other plugins, using a snippet like the following.

    Alternatively you can make larger modifications, including ones like this, by following our themer’s guide. From the sounds of it the specific file you want to modify would be: /the-events-calendar/views/modules/bar.php

    – Brook

    Posts: 9 Topics: 7
    | Permalink

    This is great and I was able to solve my issues. Is there a way to adjust the “no events found” message? Which file would I find that in? I’d like to include some instruction on adjusting the range with the filter to find more results

    Posts: 4809 Topics: 3 Answers: 6
    | Permalink

    Awesome! You actually can use that same snippet to modify the No Results Found as well. Just copy the if {…} statement, and modify the part within the parentheses to match the exact text string you want to modify. Then change that text string.

    Does that make sense?

    – Brook

    Posts: 4809 Topics: 3 Answers: 6
    | Permalink

    Howdy aabarnod,

    Since this thread has gone two weeks without a reply I am going to close it. If at any point in the future you would like to pick this topic up, feel free to open a new thread. Thanks!

    – Brook