TeddyCoder | Web Freelancer in Hochiminh City

Google map custom field error (not pin to address)

--> create gmap.js and put in themes folder , follow path : /wp-templ/library/js/gmap.js

--> in file function.php , input function :

function my_theme_add_scripts() {
wp_enqueue_script( 'google-map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyASAgo1GyixUQPFE9IpMixmp5BR3FB331w', array(), '3', true );
wp_enqueue_script( 'google-map-init', get_template_directory_uri() . '/library/js/gmap.js', array('google-map', 'jquery'), '0.1', true );
}

add_action( 'wp_enqueue_scripts', 'my_theme_add_scripts' );

function my_acf_google_map_api( $api ){

$api['key'] = 'AIzaSyASAgo1GyixUQPFE9IpMixmp5BR3FB331w';

return $api;

}

add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');

Project : funiture dome

--> Link Solved : https://www.aliciaramirez.com/2015/02/advanced-custom-fields-google-maps-tutorial/

BACK