Articles of geo data

Post queries by latitude and longitude

I am struggling with getting post queries by coordinates. I have meta fields map_lat and map_lng for almost all post types. I am trying to return posts from one custom post type (“beaches” in this example): function get_nearby_locations($lat, $long, $distance){ global $wpdb; $nearbyLocations = $wpdb->get_results( “SELECT DISTINCT map_lat.post_id, map_lat.meta_key, map_lat.meta_value as locLat, map_lng.meta_value as locLong, […]

Geo Mashup Maps show only specified categories

I’m using the Geo Mashup plugin to display maps on my site. I’ve changed a pages template, so it now only lists pages from certain categories instead of listing them all, which has now effected my global map to only show maps from the first categories I specify should be listed. I’m using: <?php echo […]

Redirect user on first visit based on geographical location

My project has two versions of the website – American and International. This is not localization, language is same, only content changes. I have created subdomain for the US version and kept international version on main domain. Now, I googled for solutions to redirect US users to US website by default and used Geo redirect […]

Querying posts by latitude and longitude to build a Google Maps with several markers

I have 4 different post types and 4 differey taxonomies Each term for each taxonomy stores a marker (url to a png icon). Each post has coordinates attached with Advanced Custom Fields and I’ll probably use Geo Data Store to optimise scalability. a) how would you ideally query for the posts which fall under a […]

How to concatenate two separate colums into one?

In phpmyadmin I have two separate columns for latitude and longitude. e.g. lat: ‘38.897683’ lng:’-77.03649′. These coordinates are generated for my location custom posts. How can I automatically merge them into a new (third) column so that I have the values in one string: ‘38.897683,-77.03649’. I would like to apply this to both the preexisting […]

Anyway to have google maps display multiple AND unique locations per individual posts/pages?

Having the hardest time finding a solution to a big problem. So far I can’t find any plugins that are capable of doing this. I have a site where each post needs to have it’s own google map that pulls from a list of locations that are unique to THAT map being displayed on THAT […]

Add post location with mile radius allowing search

I have a custom post type (CPT) called directory. Within this CPT there are taxonomies such as builder, plumber, painter etc. I would like to be able to add a location and a distance radius where the service is available. Example 1 A post (A) has a location of London and a mile radius of […]

Pass data from wordpress to javascript in JSON

Currently using this simplified code to pass data from WP to JS. function add_map_data() { $objName = “MapData”; $array = array( “MapViewLatitude” => “51.505”, “MapViewLongitude” => “-0.09”, ); wp_enqueue_script( ‘mapdata’, get_bloginfo(‘template_url’).’/custom/map.js’, null, null, false ); wp_localize_script( ‘mapdata’, $objName, $array ); } add_action( ‘wp_enqueue_scripts’, ‘add_map_data’); The only issue is that this is passing object. How can […]

Redirection based on location but without affecting search bots

A client has a successful UK site based powered by WordPress and is launching a US arm. While the US sub-sites are built, he has a holding page that is visible to US visitors, who are redirected to it from the usual home page by the Geo Redirect plugin. I’ve just realised that Geo Redirect […]

Geo Targeting articles on a WordPress site

I want to display the articles on my WordPress site depending on the location of the User. I am looking for a country based classification. Is there any already existing plugin that can help me with this? I searched on the WP site but the plugins available there just hide a small block of the […]