I got it, wasn’t registering my scripts properly 😉
wp_register_script( 'wl-googlemaps-api', '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array(), '3', true);
wp_register_script( 'wl-googlemaps', get_template_directory_uri() . '/js/googlemaps.js', array('wl-googlemaps-api', 'jquery'), '0.1', true );
thnx to http://www.aliciaramirez.com/2015/02/advanced-custom-fields-google-maps-tutorial/
best,
-jennyb
Heya,
Gonna jump in on this thread because I’m having the same problem. Trying to implement Googlemaps for the first time, have followed the instructions, but getting nothing on the front-end. Not sure if McPersonProject got his/her working, but here’s what I’ve got.
Functions.php :
wp_register_script( 'wl-googlemaps-api', '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false');
wp_register_script( 'wl-googlemaps', get_template_directory_uri() . '/js/googlemaps.js');
if ( is_singular() ) {
wp_enqueue_script( 'wl-googlemaps-api' );
wp_enqueue_script( 'wl-googlemaps' );
}
Have tried removing conditional, no change.
In my template :
<?php
$location = get_field( 'map' );
if( !empty( $location ) ){ ?>
<div class="acf-map">
<div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div>
</div>
<?php } ?>
I see the grey box whether or not there is a map defined.
Have double-triple checked my variable names.
js/googlemaps.js contains the script you provided, no html.
I do see both scripts loading, not sure what I’m doing wrong 🙁
thnx!
-jennyb
Hi John,
Thanks for your reply. Yes, I did actually get this worked out. And no, neither use of the images was via short code. The gallery images are being used for an XML feed (no watermark), while the basic attached images are displayed on a single post page via a custom loop (with watermark).
I figured out that all I needed to do was loop through my gallery images, then exclude them from my main attachments loop. Voilà!
Cheers,
-jennyb
Thanks, LingoSam. I would say that’d make a great page to add for people like me for whom it’s not that obvious 🙂 or could probably figure it out, but like to have things printed in black and white to fall back on 🙂
Yes, documentation on radio buttons would be nice! 🙂
Hey Marindee – am trying to accomplish the same thing and wondering how you ending up solving this?
thnx!
-jennyb
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.