This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
In the while, because you helped me in the past with the code can i take this opportunity to ask you about a toolset code integration ?
I would help to integrate a shortcode to order posts based on a custom field. I Would create a view in a location cpt to sort nearest location(s) to that.
I have a "location" post type
I would create a view inside the location post template
This views shows the nearest location to the actual ordered by distance.
I can't see any views to choose a custom field as distance from this, so i would create an extension to this
I understand better now, thank you. You would like to filter by distance and order the results by distance as well. It requires a bit of custom code, and I helped another client with a similar setup. Please review this forum ticket and let me know if you have questions about implementing this solution: https://toolset.com/forums/topic/sorting-views-by-distance-to-current-post-geolocation/
I'll be glad to give you more feedback if you have concerns.
Can you share all the code you used so I can see the exact changes you made?
1. The wpv-view shortcode used to display the map
2. The toolset-maps-distance-view shortcode used to display the distance
3. The full PHP code snippet to filter wpv_view_settings
I will review the changes and give you some feedback.
Hi, the locali-intorno-a-questo View shortcode seems to be formatted incorrectly, which will cause a problem with the distance calculation. Please try this change:
If this does not resolve the problem, I'll be glad to take a closer look in wp-admin. Please provide login credentials here and let me know where I can see this content on the front-end of the site.
The topic ‘[Closed] Shortcode to sort posts’ is closed to new replies.