Tell us what you are trying to do?
List nearest cities of custom post types.
I have State/City Taxonomy pages (hidden link)
That have term type field: [si-addy-city-state] which is an Address field that in this example contains: Appleton, Wisconsin, USA
That have term type field: [parent_term_info output='name'] which plain text returns: Wisconsin
It's not possible to run a distance view for taxonomies, I built a workaround by creating a custom post type 'Individual Cities', which contain the permalink to the matching taxonomies, and geographic data, so then I can sort by distance (mild workaround).
On the taxonomy page in this example, I call a view of those 'Individual City' with the attached screenshot view, with this code (some excess due to trial and error):
[wpv-view name='cities-near-input-city-list' mapcenter='[types termmeta='si-addy-city-state']' from_center='[types termmeta='si-addy-city-state']' parentstate='[parent_term_info output='name']' limit='8']
The goal is to list the 8 cities nearest to 'Appleton, Wisconsin, USA', sorted by closest to furthest.
Ordering: I have done URL parameter: mapcenter, toolset_maps_distance_center, and the above shortcodes.
The 'parentstate' filter is used to keep the query shorter, and also to lock the results by state (this works)
The mapcenter shortcode attribute for 20mi distance works, so it's receiving the right 'Appleton, Wisconsin, USA' and running it through the 'Individual City' custom posts. It definitely finds the nearby cities, but does not order by distance.
Ordering by distance does not work, regardless of any attempts to debug as listed above, it only will display alphabetical, which is not ideal at all lol.
I have attached what the DB query looks like on the front end, seems confused about something but this is above my skill level.
Is there any documentation that you are following?
The 'standard' methods, other blog posts, archived tickets (such as: https://toolset.com/forums/topic/sorting-views-by-distance-to-current-post-geolocation/#post-1140488) I have tried this method and added the code to functions and experimented to no results.
What is the link to your site?
hidden link