Home › Forums › MapPress Support › To Display Map In Side Bar › Reply To: To Display Map In Side Bar
May 21, 2013 at 12:15 pm
#12637
Hi,
I’m not sure I understood. If you just want to display the map for the current post, the widget has a ‘current post’ option, or you can use query=”current” in the [mashup] shortcode.
If you want to use PHP, you can get all the maps for a particular post using Mappress_Map::get_post_map_list($postid).
For example this should display the first map for the current post:
<?php
global $post;
$maps = Mappress_Map::get_post_map_list($post->ID);
if (isset($maps[0]))
echo $maps[0]->display();
?>