Support

Account

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.