Home › Forums › Front-end Issues › Google Map – How to display? › Reply To: Google Map – How to display?
I think you can add this code in your function.
$location = get_field('location');
if( !empty($location) ){
echo '<div class="acf-map">
<div class="marker" data-lat="'.$location['lat'].'" data-lng="'.$location['lng'].'"></div>
</div>';
}
Then with regards to your script and styles you can add it using wp_enqueue_script() a wordpress core function on adding css and js.
Source for ACF Google Map: http://www.advancedcustomfields.com/resources/google-map/
Source for WP Enqueue Script: http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Thats it definitely you can display the map on the frontend.
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.