Support

Account

Home Forums Add-ons Repeater Field Using Google Maps Multiple locations with Anchor links

Solved

Using Google Maps Multiple locations with Anchor links

  • I have a repeater with Google maps that gives me a multiple locations marker on the map.

    Inside the map repeater, BUT OUTSIDE THE MAP!, I have a nested repeater of photos. Because the popup box from the marker is small, I’m trying to link down the page with an anchor using sanitize_title_with_dashes(); Because the acf-map div goes between the endwhile; and endif; my link down the the nested photo repeater is not coming up.

    It only seems to render if before the endwhile; So how should I code this?

    This is what I thought would work:

     <?php if( have_rows('rapids_map') ): ?>
    	<div class="acf-map">
      		<?php while ( have_rows('rapids_map') ) : ?>
    			<?php the_row(); ?>
                
    			  #anchorLinkDown
                  
           <?php endwhile; ?>
        </div><!-- acf map -->
        
         <?php  if( have_rows('photos_map') ): ?>
      		<?php while ( have_rows('photos_map') ) : ?>
    			<?php the_row(); ?>
                
                 <a name="anchorLinkDown"></a>
                 My photos...
                 
              <?php endwhile; ?>
    		<?php endif; // end photos ?>
        
    <?php endif; // end multiple locations ?>
  • Nevermind, I solved it. Just had to run the repeater again below.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Using Google Maps Multiple locations with Anchor links’ is closed to new replies.