I have posts which are geocoded with latitude and longitude from Google. I basically can enter an address in a post custom field and the latitude and longitude are placed into two separate meta fields.
I’d like to create a custom search letting visitors search their zip/postal code and find the nearest locations.
I’ve found this plugin which does all that bundled in one with custom post types then a search page http://wordpress.org/extend/plugins/wp-find-your-nearest/
I was thinking to try and modify it to work with my custom meta fields and only use the search page/function. Does anyone know of any other plugins or methods to create a custom search using postal codes and radiuses from lat / long meta fields
Thanks
There’s Geo Data Store by our own man, @Brady. It does a perfect job in one of my installations.
It uses a custom table, that stores only ID, meta ID, lat and lng information, so your queries stay quick and brief, even when your database starts scaling. It got a 5 star rating from my side.
@Brady in the plugin description.
Note: There’s a bug – related to WP internals – that rows don’t delete, when you delete a post. Don’t be concerned about it. I tried to work through it with the dev and we didn’t get behind it. Anyway: It doesn’t harm anything, but you should clean up your tables, before you go live (or test in a local installation), to minimize the amount of non related rows.
Sample code from Scotts pastebin in the comments