Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hawkidoki/2b8bc30efeed623765cf68914edaf2d9 to your computer and use it in GitHub Desktop.
Save hawkidoki/2b8bc30efeed623765cf68914edaf2d9 to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<?php if(have_posts()): ?>
<?php while(have_posts()): the_post(); ?>
<?php if($map = get_field('google_map')){ ?>
<?php $options = get_field_object('google_map'); ?>
<div class="acf-map"<?php hwk_acf_map_atts($options); ?>>
<div class="marker" data-lat="<?php echo $map['lat']; ?>" data-lng="<?php echo $map['lng']; ?>"<?php hwk_acf_map_icon($options); ?>></div>
</div>
<!-- Résultat:
<div class="acf-map" data-zoom='5' data-style='[{"featureType"...}]'>
<div class="marker" data-lat="5.00000" data-lng="5.00000" data-icon="http://www.example.com/themes/mon_theme/assets/markers/1.svg"></div>
</div>
-->
<?php } ?>
<?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment