Display Posts,Pages or Custom Post types on google maps

You are here : Home / Display Posts,Pages or Custom Post types on google maps

google mapTo display posts,pages or custom post types over the google maps is useful feature in th is plugin. You can display posts on google maps using your own custom fields or wp google map pro meta box added by this plugin. You can display post title, post excerpt, post content, post categories, post tags and custom fields without any programming.

How to Apply

To display posts on google maps using your own custom fields, you can follow below steps.

  • Step 1 : Download the plugin from codecanyon and install on your wordpress site.
  • Step 2 : Create a blank map from ‘Create Map’ page or copy an existing map using ‘Manage Maps’ page.
  • Step 3 : Go to ‘edit map’ page and enable ‘Geo Tags’ feature and provide your custom fields names in address,latitude,longitude and category boxes. Below is screenshot of easy to use interface.

    Display Posts on the google maps using custom fields

  • Step 4 : Now you can setup posts information to be displayed on the infowindow message using placeholder – {post_title}, {post_link}, {post_excerpt}, {post_content}, {post_featured_image}, {post_categories}, {post_tags}, {%custom_field_name_here%}. Below is screenshot.
    Display Posts information in infowindow message
  • Step 5 : Put the shortcode of the map on page or post where you want to display google maps. You can get shortcode of the map from ‘Manage Maps’ page. and You’re Done!

Example to Display Posts Information on the Google Maps.

Hooks

You can modify infowindow content using ‘wpgmp_geotags_content’ to display feature image or custom fields or title with post link etc. Below is example code which you need to place in functions.php


add_filter('wpgmp_geotags_content','wpgmp_geotags_content',1,3);
function wpgmp_geotags_content($content,$post_id,$map_id) {

	$content = ""; //reset the $content
         //retrieve post title
         $content = "Post Title : ".get_the_title($post_id);
        //retrieve featured image of the post
         if (has_post_thumbnail( $post_id ) ) {
 
         $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'single-post-thumbnail' ); 
 
         $content .= "<br>Featured Image : <img width='100' height='100' src='".$image[0]."' />";
 
         }
         //retrieve the_excerpt of the post
         $content.="<br>Post Excerpt : ".get_the_excerpt($post_id);
         //retrieve custom fields value of the post. 
         $content .="<br>Custom Field : ".get_post_meta($post_id, "show_facebook", true);
         //return your modified infowindow message. 
         return $content;
}

How to Buy

You can buy this plugin from codecanyon in just $28 and email us at hello@flippercode.com or create a support ticket using helpdesk for any type of query or help regarding this plugin.

banner_728x90

Customize Product according to your requirements?

We will be glad to discuss any of your needs related to our wordpress plugins . if any of functionality you'd like to see in products, you can reach us by via email hello@flippercode.com.