• Resolved Justin V

    (@enfueggo)


    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!

    https://wordpress.org/plugins/wp-google-map-plugin/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Flipper Code

    (@flippercode)

    Hello,

    Yeah, That’s doable and make sense also. I’ll release next version soon with new features.

    Thanks

    Plugin Author Flipper Code

    (@flippercode)

    Hello,

    I have updated the plugin according to your suggestions and removed unused files. Though it’s best practice to load google.com/jsapi in the header and we can display map in a widget,pages or posts so we can’t find on which page exactly we need it to include. So I keep loading google api file in header.

    I really appreciate your contribution to make it a perfect product.

    Thanks

    Thread Starter Justin V

    (@enfueggo)

    Great, thanks Flipper Code!

    Plugin Author Flipper Code

    (@flippercode)

    Hope this issue resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Only inject JS/CSS on pages where map is being displayed’ is closed to new replies.