Reply To: Template tag

Home Forums MapPress Support Template tag Reply To: Template tag

#10512
Chris
Keymaster

    Hi,

    Here’s how you can get a list of maps for the post, then use the first map in the list:

    $maps = Mappress_Map::get_post_map_list($post->ID);
    if (!empty($maps)) {
    	$mapid = $maps[0]->mapid;
    	do_shortcode('[mappress mapid="$mapid"]');
    }