New Landing How can we help? Cardinal Disable Google Maps

Viewing 12 posts - 1 through 12 (of 12 total)
  • Posted in: Cardinal
  • #96547
    icecast
    Member
    Post count: 182

    where can i disable google maps? i do not use it, and it is taking nearly 3 seconds to load

    #96561
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Not sure what you are referring to? If you do not have a Google map on the page then there will be nothing to load?

    – Kyle

    #96563
    icecast
    Member
    Post count: 182

    the theme is still requesting the google map api

    #96637
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Maybe it’s from any additional plugin that you have installed. try to deactivate all plugins to see if it still loads google maps. Or activate the default WordPress theme without deactivating the plugins.

    We only load google maps when you using a Directory asset from the page builder.

    – Rui

    #96967
    icecast
    Member
    Post count: 182

    /cardinal/functions.php seems to suggest otherwise – my guess is that i just need to change ‘TRUE’ TO ‘FALSE’

    /* LOAD FRONTEND SCRIPTS
    ================================================== */
    if (!function_exists(‘sf_enqueue_scripts’)) {
    function sf_enqueue_scripts() {

    // Variables
    global $sf_options;
    $enable_rtl = $sf_options[‘enable_rtl’];
    $enable_min_scripts = $sf_options[‘enable_min_scripts’];
    $post_type = get_query_var(‘post_type’);

    // Register Scripts
    wp_register_script(‘sf-bootstrap-js’, SF_LOCAL_PATH . ‘/js/bootstrap.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-flexslider’, SF_LOCAL_PATH . ‘/js/jquery.flexslider-min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-flexslider-rtl’, SF_LOCAL_PATH . ‘/js/jquery.flexslider-rtl-min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-isotope’, SF_LOCAL_PATH . ‘/js/jquery.isotope.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-imagesLoaded’, SF_LOCAL_PATH . ‘/js/imagesloaded.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-owlcarousel’, SF_LOCAL_PATH . ‘/js/owl.carousel.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-jquery-ui’, SF_LOCAL_PATH . ‘/js/jquery-ui-1.10.2.custom.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-ilightbox’, SF_LOCAL_PATH . ‘/js/ilightbox.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-maps’, ‘//maps.google.com/maps/api/js?sensor=false’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-elevatezoom’, SF_LOCAL_PATH . ‘/js/jquery.elevateZoom.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-infinite-scroll’, SF_LOCAL_PATH . ‘/js/jquery.infinitescroll.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-theme-scripts’, SF_LOCAL_PATH . ‘/js/theme-scripts.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-theme-scripts-min’, SF_LOCAL_PATH . ‘/js/sf-scripts.min.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-functions’, SF_LOCAL_PATH . ‘/js/functions.js’, ‘jquery’, NULL, TRUE);
    wp_register_script(‘sf-functions-min’, SF_LOCAL_PATH . ‘/js/functions.min.js’, ‘jquery’, NULL, TRUE);

    #97087
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @icecast,

    Best thing to do would be to add that function to your child theme, and then you can remove the scripts you don’t want to include.

    Unfortunately Envato don’t allow us to use script include methods which would allow us to output only the scripts needed, so we have to include all.

    FYI – 3 seconds to load is much longer than it should take. I.e. our demo sites usually loads completely in < 1-2 seconds.. - Ed

    #97386
    icecast
    Member
    Post count: 182

    thanks, i commented out google maps, font-awesome, swift-slider, owl carousel, ilightbox, woo-commerce and gizmo

    pagespeed score improved 10 points

    #97388
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Ok great!

    – Kyle

    #114177
    danx88
    Member
    Post count: 31

    Hi Ed,
    I’m having the same issue, and want to increase my Google speed ranking by deactivating the scripts I don’t use, could you please let me know what these scripts do(so I can decide which ones to remove), and how exactly I can place a code in the function.php of my child theme to prevent them from loading?

    /js/jquery.flexslider-min.js
    (I only use RevSlider and the built in one for gallery short-codes, do I need this?)

    /js/jquery.isotope.min.js

    /js/jquery.carouFredSel.min.js

    /js/jquery.fitvids.js

    /js/jquery.elevateZoom.min.js

    http://maps.google.com/maps/api/js?sensor=false
    (I’m sure I definitely won’t use Google Maps on site, so I need this to be removed.)

    Thanks
    Sia

    #114288
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi Sia,

    /js/jquery.flexslider-min.js
    This is any slider which isn’t revolution slider

    /js/jquery.isotope.min.js
    This powers the masonry layouts

    /js/jquery.carouFredSel.min.js
    This is far carousel assets

    /js/jquery.fitvids.js
    This is for responsive videos.

    /js/jquery.elevateZoom.min.js
    This is for product image zoom on product detail page

    Hope that helps.

    – Ed

    #114344
    danx88
    Member
    Post count: 31

    Thanks for the info Ed,
    so I only need to copy the exact function into function.php of the child theme and then delete the lines I don’t need?

    #114362
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Yes or you could comment them out 🙂

    – Kyle

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register