Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #427703


    In my child theme, I have a custom template that I need to embed a Google Map into that uses the wordpress loop to put a marker on a map for each blog post. Each blog post has latitude and longitude coordinates already in it’s meta data. How can I hook into the existing Google Map API that ships with Enfold to embed a custom map into a custom template?

    I know how to do it using these instructions:
    But that is with a site without the Google Map API already being loaded.

    Any insight you have will be greatly appreciated!


    Hi dmvieira!

    It doesn’t matter whether we load the API or if you load it as long as a copy of it is loaded.

    When you follow their tutorial just skip this line.

    <script type="text/javascript" src=""></script>

    Because we already have it loaded.



    Hi Elliot,

    For my custom template, I just duplicated page.php and renamed it. I have removed the callout to the external Google Map API. It still didn’t seem to work. Then I added onload=”initialize()” to the body tag and I get this error:

    Uncaught ReferenceError: google is not defined

    It stems from this code:

    var mapOptions = {
    		zoom: 11,
    		center: new google.maps.LatLng(33.683415, -117.1542139),
    		mapTypeId: google.maps.MapTypeId.ROADMAP

    The Google Maps API that ships with Enfold doesn’t seem to be getting loaded for this page.

    Should I use a different page template to use as a base for my custom template? Maybe index.php?

    Again, any help is much appreciated.


    In my new Themes / Installation there is always the following lines in the header:

    <script type='text/javascript' src='//'></script>


    And how to deactivate this?

    It is slowing down websites.



    , Sorry, what I meant was it gets loaded when you use our map shortcodes. If your using it on a page with no map shortcodes then go ahead and leave that line in.

    , That should not be loading on it’s own. Perhaps your using a plugin that is loading it or your embedding a map in the page? Send us a link and we’ll take a look.


    • This reply was modified 9 years, 2 months ago by Elliott.

    it seems that the plugin “mycalendar” is causing that problem. But I’m not using the maps.

    On that sites:

    here the topic has been treated before: But the code is not working°


    Thanks Elliot. I got it to work. I am conditionally enqueueing the Google Map API for just one page, along with the onload initialize in the body tag. No errors to speak of! Thanks again.



    , That is for disabling the maps API from loading when using our map shortcodes or the widget. To stop your plugin from loading it you will need to contact the plugin authors.

    Best regards,

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.