Jump to content

VinceGledhill

Members
  • Posts

    133
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

VinceGledhill's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello People. I have a site that I am trying to paste multiple pins on a single map in a wordpress site, using cbxgooglemap plugin and advanced custom fields for my lat and long information. The following code works fine for one pin, on one map. echo do_shortcode('[cbxgooglemap lat="'.get_field('latitude').'" lng="'.get_field('longitude').'" ]'); However, when I try to post it within the loop, I simply get multiple maps, instead of one map, with multiple pins. Here is the code that doesn't work correctly, it gives me 3 maps. <?php $justMap = new WP_Query(array( 'posts_per_page'=> 3, 'post_type' => 'airfield_card' )); while($justMap->have_posts()){ $justMap->the_post(); echo do_shortcode('[cbxgooglemap lat="'.get_field('latitude').'" lng="'.get_field('longitude').'" ]'); } ?> Please can someone tell me how to alter the code so that a single map is outside the loop, but still embedding each pin from the loop. Kind Regards VinceGledhill
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.