Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #748009

    Hi,

    Although the Google Map is only displayed on the contact page, the Google Maps scripts are loaded on every page.
    How can I prevent this from happening?

    Regards,
    Jan

    #750085

    Hey Jan,

    this is the default setting. If you deactivate it things won’t work well anymore. However, yo could hire a freelance developer for this job, if you really need it.

    Best regards,
    Andy

    #751549

    Hi Andy,

    Thanks for you feedback on this.

    Best regards,
    Jan

    #751555

    well there are a lot of code snippets here on board to deactivate google maps.
    maybe something like this is working. (you can see that accept page 3184 the maps api isn’t loaded)

    this comes to child-theme functions.php:

    add_filter('avf_load_google_map_api', 'disable_google_map_api', 10, 1);
    function disable_google_map_api($load_google_map_api) {
    if( !is_page(3184) ) {
            $load_google_map_api = false;
            return $load_google_map_api;
    }
    }

    But ! if you have the maps in the widget area you have to see how you can manage it.
    And if you use some caching tools – i don’t know how if this will work too
    On a test installation of mine it seems to work Link

    #752039

    Hi Guenni007,

    Thank you for providing the code snippet, I will check if it is working for me.

    Regards,
    Jan

    #752287

    Thanks @Guenni007

    Let us know if you still need help with this @jawes

    Best regards,
    Andy

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