Support

Account

Home Forums ACF PRO Search contents by latitutine, longitude and radius Reply To: Search contents by latitutine, longitude and radius

  • Hi @frabiacca

    ACF saves the google map field in a serialized string like this:

    a:3:{s:7:"address";s:47:"399 King St, West Melbourne VIC 3003, Australia";s:3:"lat";s:18:"-37.81093672361003";s:3:"lng";s:18:"144.95318412780762";}

    To get the nearest location based on the lat/lng, I believe you need more than wp_query. You can use the wpdb class to query do the query and calculation, but it’s not an easy task. Please take a look at this thread to learn more about the calculation: http://stackoverflow.com/questions/11112926/how-to-find-nearest-location-using-latitude-and-longitude-from-sql-database.

    If you don’t understand it, I suggest you hire a developer to help you out with it, and I’d recommend looking for one on https://studio.envato.com/ or https://www.upwork.com/.

    I hope this helps.