When you activate the Advanced Search Filters, the Search By Distance field will automatically be added to the fields you can add to your custom search.
When you click on Field: Search by Distance, you’ll see the following options:
Maximum Search Range
Enter the maximum radius of the search zone you want to create, for example if you want your visitors to search any listing within 50 miles or kilometers from the current location, then you would enter 50.
You have to set your choice of miles or kilometers at
WP admin > GeoDirectory > General > Search > Show search distances in miles or km
Difference in Search Range
Here you decide how many different search radii you make available to your visitors.
If you enter a fifth of the Maximum Search Range, there will be 5 options; if you enter half of the Maximum Search Range, then there will be 2 options.
Expand Search Range
If you leave this blank, then all options as per Difference in Search Range will be shown.
Entering a number lower than the number of options as per Difference in Search Range will only show that lower number of options, and will add a More link to expand the options so all will be shown.
Show distance sorting:
Tick this if you want your visitors to be able to sort the search results in order of distance, either ascending or descending.
You will also need to provide text for the ascending or descending options.
This will be shown as the heading of the Search By Distance filter.
Optional description shown below to give your visitors tips about how to use the filter.
Example 1: all options
The following example illustrates all the options:
- The search will search all relevant listings within a maximum 100 km radius (Maximum Search Range = 100)
- Visitors will be able to choose a smaller radius than 100km, in 20 km increments (Difference in Search Range = 20)
- Visitors will initially have 4 options to choose from (Expand Search Range = 4)
- Visitors will be able to order the search results by closest or furthest away (Show distance sorting = checked)
- The first image is how the search will initially show: Our heading and 4 options
- The second image shows what happens if the visitor clicked on More; all the options would be revealed
- The third image shows how the visitor can choose to order by closest or furthest away
Example 2: minimal options
- Visitors will only have two options because the Difference in Search Range is half of the maximum radius
- No other options will be available to the visitor