Support

Account

Home Forums Add-ons Repeater Field Repeater Field, Post Object and Google Map Reply To: Repeater Field, Post Object and Google Map

  • I found the solution, i post it here if it can help someone :

    <?php if( have_rows('evenement') ): ?>
    	<div class="map">
    	<div class="acf-map">
        	<?php while ( have_rows('evenement') ) : the_row(); ?>
    			<?php $post_object = get_sub_field('lieu_evenement');if( $post_object ): ?>
    				<?php $post = $post_object; setup_postdata( $post ); ?>
    					<?php $location = get_field('geolocalisation'); if( !empty($location) ):?>        
    						<div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>">
                        		<div class="lieu"><?php the_title(); ?></div>
                        	</div>
    					<?php endif; ?>
    				<?php wp_reset_postdata();  ?>
    			<?php endif; ?>
    		<?php endwhile; ?>
    	</div>
        </div>
    <?php else: ?>
    <?php endif; ?>