Home Forums Front-end Issues Google Maps Field Frontend Issue Reply To: Google Maps Field Frontend Issue

  • Hi @jmdesignsolutions

    Please keep in mind that you only need to add the Google Maps script once. So it should be something like this:

    function my_theme_add_scripts() {
        wp_enqueue_script( 'google-map', '', array(), '3', true );    
        wp_enqueue_script( 'google-map-init', get_template_directory_uri() . '/js/google-maps.js', array('google-map', 'jquery'), '0.1', true );   
    add_action( 'wp_enqueue_scripts', 'my_theme_add_scripts' );

    Please don’t forget to replace the “KEYGOESHERE” text with your Google Maps API key.

    If the issue persists, could you please check the console tab of your developer tools for any JavaScript error messages on the page?

    Thanks 🙂