Geo Targeting articles on a WordPress site [closed]
You can use WP Geolocation JS and use JS or Shortcode to hide the content
You can use WP Geolocation JS and use JS or Shortcode to hide the content
You could use this plugin, although it may only be compatible to 3.2.1. And this plugin may help you out, although it seems a little complicated to implement a map for all the posts. You could also use a custom field for lat/long on each post, and then create markers using wpdb calls, grabbing the … Read more
Lots of ways to proceed here. Here’s one way to do it: Find a JavaScript/jQuery plugin that works with map markers. I used Mosne Map, it’s old but it works. Generate the HTML markup that the above plugin will use. I needed a more user-friendly way to add markers, so I utilized ACF’s Repeater Field … Read more
Close. You need another INNER JOIN and should escape all your variables using $wpdb->prepare. I’ve also included a more efficient Haversine formula (source) to calculate the radius. If you use kilometers, then change the $earth_radius to 6371. Also, a great way to debug is to echo the sql and paste it into phpMyAdmin (or whatever … Read more
The problem was when I send the query to the database it was changing my array level other than that the ‘s’ value was not going empty due to which it was preventing my records to be fetched and the third and most important one was the way I was making my query by changing … Read more
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 … Read more
I would suggest rolling your own. Create a metabox that allows posts to store lats and longs on posts. Then create a page that finds all the posts with the tags that you want that can grab the lats and longs from each post meta data. Using that post meta data create a json variable … Read more
Can you use a plugin? I just released not long ago http://geomywp.com it basically does what you want. If you want to do it yourself so this is how I did it: The plugin adds address custom fields (as meta boxes) to your post type. When post is being saved the address being converted to … Read more
I would duplicate the coordinates of the posts in a separate table (post_id, lat, lon), with an index on (lat, lon). With all the joins and the casts I doubt the database can use an efficient index with your query. I once wrote an answer to a similar question using this approach.
Can do this without any plugin, you need only the Google Maps API. Please note that if you plan to have 20 markers or more on a single page, you have to geolocate posts using coordinates and not addresses. To save coordinates from an address you can: manually use a service (something like this) call … Read more