Title: adding map image to posts loop
Last modified: August 21, 2016

---

# adding map image to posts loop

 *  [ellebillias](https://wordpress.org/support/users/ellebillias/)
 * (@ellebillias)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/adding-map-image-to-posts-loop/)
 * was just wondering how I can get the map to display for each post in the loop
   on my project page.
 * have tried using wpgeo_post_static_map, both with the post ID passed and without
   but it returns empty and there’s no example of how to use this function. I’m 
   trying to use the map instead of a featured image so it doesn’t have to be interactive,
   is the static function the correct function?
 * [https://wordpress.org/plugins/wp-geo/](https://wordpress.org/plugins/wp-geo/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ben Huson](https://wordpress.org/support/users/husobj/)
 * (@husobj)
 * [12 years ago](https://wordpress.org/support/topic/adding-map-image-to-posts-loop/#post-4832788)
 * It sounds like your are using it correctly. I have written some [brief documentation](https://github.com/benhuson/WP-Geo/wiki/get_wpgeo_post_static_map).
 * One thing to not is a static map cannot be created if one of the dimensions is
   a percentage – they must be numbers. You can override the width/height parameters
   by passing them as a second argument to the wpgeo_post_static_map function. See
   the documentation link above.
 *  Thread Starter [ellebillias](https://wordpress.org/support/users/ellebillias/)
 * (@ellebillias)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/adding-map-image-to-posts-loop/#post-4832810)
 * Hi Ben,
 * Thanks for the updated documentation, however it’s still not working! I’ve checked
   that the ID is accessible (it is) yet nothing displays using the function as 
   you posted.
 * I have assigned it to a variable and then echo the variable in my output where
   I need it to show the map yet the map part does not come up!
 *     ```
       $map =	get_wpgeo_post_static_map( get_the_ID(), array(
       		'width'   => '275',
       		'height'  => '200',
       		'maptype' => 'G_PHYSICAL_MAP',
       		'zoom'    => 10,
       	));
       	echo '<div class="map">' . get_the_ID(). $map . '</div>';
       ```
   
 * maybe you could have a look at my test site and see what is happening: [http://dev.ecowebdesign.com.au/tgl/our-projects/](http://dev.ecowebdesign.com.au/tgl/our-projects/)
 *  Thread Starter [ellebillias](https://wordpress.org/support/users/ellebillias/)
 * (@ellebillias)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/adding-map-image-to-posts-loop/#post-4832813)
 * I have also just noticed that it seems to work on the single page: [http://dev.ecowebdesign.com.au/tgl/projects/kyrgyzstan/](http://dev.ecowebdesign.com.au/tgl/projects/kyrgyzstan/)
 * but not on my page template!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘adding map image to posts loop’ is closed to new replies.

 * ![](https://ps.w.org/wp-geo/assets/icon-256x256.png?rev=993625)
 * [WP Geo](https://wordpress.org/plugins/wp-geo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-geo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-geo/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-geo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-geo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-geo/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [ellebillias](https://wordpress.org/support/users/ellebillias/)
 * Last activity: [11 years, 12 months ago](https://wordpress.org/support/topic/adding-map-image-to-posts-loop/#post-4832813)
 * Status: not resolved