Map not working even though API key is good
-
The map view in the All-in-one?event calendar?shows a “This page can’t load Google Maps correctly.” error message. However, when I create a new post or page and use the Google Map plugin/option within my (Enfold) theme, the map views fine.
My WP version, theme, and plugins are all current. So, was wondering what the problem might be. I then did a View Source on the event and saw that for some reason the API key was not anywhere to be found.So I then put the following script into the <head> of my header.php file:
<script src=”//maps.googleapis.com/maps/api/js?key=MY_CURRENT_API_KEY”></script>
and it worked. However, I had someone a few months ago review my site for speed performance and he had flagged this particular script as an issue.So, in your opinion, wouldn’t this script then try to load Google Maps on every page of the website, thereby slowing down every page? If so, how can I get the API key to load only on Event posts?
The page I need help with: [log in to see the link]
- The topic ‘Map not working even though API key is good’ is closed to new replies.