• Hi Everyone,
    I’m currently using the do_shortcode function to place the map in my page template, with PHP variables echoing out the address, zip code and name from custom meta in the post, which works great, but only outputs one pin:

    <?php echo do_shortcode('[google-map-v3 width="868" height="490" zoom="12" maptype="roadmap" mapalign="center" directionhint="false" language="default" poweredby="false" maptypecontrol="true" pancontrol="true" zoomcontrol="true" scalecontrol="true" streetviewcontrol="true" scrollwheelcontrol="false" draggable="true" tiltfourtyfive="false" addmarkermashupbubble="false" addmarkermashupbubble="false" addmarkerlist="'.$the_address.' '.$the_city.', '.$the_state.' '.$the_zip.'#http://www.apple.com#{}4-default.png{}'.$place_title.'" bubbleautopan="true" showbike="false" showtraffic="false" showpanoramio="false"]'); ?>

    I’d like to be able to run a loop and retrieve the address custom meta from all the posts, and echo it out inside of the shortcode, but I have no idea how to do this. Manually creating a shortcode with multiple addresses is out of the question, and this is the only Google Maps plugin (jQuery or WordPress-based) that maintains the default bubble when you click on the pin to invoke directions, so I’d like to continue using it.

    Can anyone please help?

    Thanks!

    http://wordpress.org/plugins/comprehensive-google-map-plugin/

  • The topic ‘Running a Loop inside of the Shortcode’ is closed to new replies.