Home › Forums › Front-end Issues › A google map with all registereds persons › Reply To: A google map with all registereds persons
Hi,
i found the soluce :
$the_query_map = new WP_Query( array( 'post_type' => 'vignerons', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'menu_order' ) );
if($the_query_map->have_posts()) :
while($the_query_map->have_posts()):
$the_query_map->the_post();
$the_ID = get_the_ID();
$link_vignerons = get_the_permalink();
$get_google_map = get_field('carte', $value);
$title_vignerons = get_the_title();
$output_map[$the_ID]['map'] = '<div class="marker" data-lat="'.$get_google_map['lat'].'" data-lng="'.$get_google_map['lng'].'"
<h4><a href="'.$link_vignerons.'" rel="bookmark"> '.$title_vignerons.'</a></h4></div>';
endwhile; endif;
wp_reset_postdata();
?><div class="acf-map"><?php
foreach( $output_map as $key => $map_marker ):
echo $map_marker['map'];
endforeach;
?>
</div>
Hope this help someone!
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.