Reply To: To Display Map In Side Bar

Home Forums MapPress Support To Display Map In Side Bar Reply To: To Display Map In Side Bar

#12637
Chris
Keymaster

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();
?>