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; ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.