Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Replace default WordPress jQuery script from Google Library

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 366
    Comment on it

    Hello Readers,

    There are default scripts that is included with each WordPress installation. These types of scripts have reached disposal regarding style as well as plugin experts to make use of of their function. Via our experience, jQuery is one of the majority of applied scripts in plug ins as well as styles. In this posting, many of us will reveal how you can change this default WordPress jQuery script together with google Library script.

    That you are almost certainly thinking about change this default WordPress jQuery script using the just one coming from google Library? jQuery has used on a lot of websites including the huge kinds. Google Library has become the requirements regarding which include scripts in web page design. It may be since google Your local library are choosing Googles CDN which can be incredibly powerful. Given it has become a typical, a lot of various other websites are selecting that as well. It is likely that your particular web site user has also went to one particular various other websites which might be utilizing Googles Library regarding scripts. And so the script has already been cached within your users web browser. That can make packing in the jQuery script very quick in users stop. Inside todays entire world whenever we usually are dealing with for each microseconds as well as optimizing our site, exactly who wouldn't adore to lower out there some sort of microsecond from your packing time?

    Now you're almost certainly thinking, how to try this? Properly its pretty simple. Open ones themes functions.php data file as well as insert the next snippet:

    //updating jQuery Google API
    function modify_function_jquery() {
        if (!is_admin()) {
            // comment out the next two lines to load the local copy of jQuery
            wp_deregister_script('jquery');
            wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js', false, '1.8.1');
            wp_enqueue_script('jquery');
        }
    }
    add_action('init', 'modify_function_jquery');
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: