Tell us what you are trying to do?
I want to sort the search results by distance from a submitted address, or the users location. When I try to change the order by in the backend, the "As a distance from" option is disabled.
Is there any documentation that you are following?
I couldn't find documentation on this though I did find a similar support request.
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hello,
How do you setup the custom field "Business 1 Postal Code"?
The distance filter only available for custom address field, see our document:
https://toolset.com/lesson-placement/lesson-placements-1622939-1625485/
Hi Luo.
Thanks for the reply.
I have 'Business 1 Address' as an 'Address'.
'Business 1 Postal Code' is 'Single Line'.
Having 'Business 1 Address' as an 'Address' should work, no?
Jim
Yes, it should work with custom address field.
Yes, it should. But it doesn't. Hence my support request.
Why would it not give me the option to sort results by distance when I set the field to the Address field?
I have tried it in a fresh WP installation + the latest version of Toolset plugins, it works fine.
See below sandbox site:
Login URL:
hidden link
Custom address field:
hidden link
Post view, sort by above address field:
hidden link
Is there any missing steps? Can you reproduce the same problem in above website?
Hi Luo.
Thank you for taking the time to set this up.
Perhaps it has something to do with the query filters I have. I've attached a screenshot that shows the 'As a distance from' disabled, as well as the rest of the Query Section. Your example looks exactly like mine, except for the query filters.
I've also included a screenshot of the Distance query filter.
Thanks for your help.
Jim
Can you reproduce the same problem in above sandbox website?
I have tried to add the distance range filter into above post view, it works fine too.
If you can not too reproduce the same problem, then there might be other compatibility/server issues in your website.
Please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/
2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme, and test again
3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/