Only inject JS/CSS on pages where map is being displayed
-
I’m using a map on only 1 page of a website (the contact page), but I noticed the plugin’s JS and CSS is being loaded on every page of the site, totaling 100kb.
/wp-google-map-plugin/css/google-map.css?ver=3.8.1
/wp-google-map-plugin/js/infobubble.js?ver=3.8.1
/wp-google-map-plugin/js/jscolor.js?ver=3.8.1
google.com/jsapi?ver=3.8.1'
Would you be able to include these on only posts/pages where the map is being displayed?
I’ve used another map plugin where the author did this with a setting that basically asked “Which post/page ID’s will maps be displayed on?” and you’d input “12, 32, etc.” and the JS/CSS would only appear on those posts/pages.
As I’ve said before, this is really a top-notch Google Map plugin. Thanks so much for creating and maintaining it!
- The topic ‘Only inject JS/CSS on pages where map is being displayed’ is closed to new replies.