WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Disable google maps API except on events pages? (6 posts)

  1. aware
    Member
    Posted 2 years ago #

    Couldn't seem to find any documentation on it. Went to the main site to look at the available filters and the page was blank.

    Seems that the google api hangs every so often. This could be due to some other js libraries loading at the same time.

    Basically just want to disable the events google maps api from loading on our clients homepage.

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

  3. aware
    Member
    Posted 2 years ago #

    Hmmm @agelonwl not sure that's what I am really looking for.

    More so looking to unenqueue the google maps on specific pages. I think I'll probably end up just looking through the source and unregister the script if I'm not on an events page.

    Thanks though. I'll post my snippet when I implement it either this afternoon or shortly there after.

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    you can just remove #_MAP from your formats and the google libraries won't be loaded.

  5. aware
    Member
    Posted 2 years ago #

    Hi Markus,

    Well for this situation. We still want the maps within the template of each event. But it's trying to load the api on the home page and it hangs constantly. I say 4 out of 5 times. It'll hang up on the loading.

    So I really just want to exclude it if is_home or is_front_page at minimum. I was going to just look though and see where the script was enqueued and either filter it myself or see about loading the googlemaps api asynchronously so it doesn't affect the rest of the scripts.

    I have this in my list of items just haven't had a chance to implement yet.

    Hopefully that makes sense. Not sure if any one else has noticed it loading the script slowly or not

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    if you can't do this with placeholders, maybe try using shortcodes/template tags on your home page and not use #_MAP in your formats.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic