Horje

Tips (Total 1)


# Tips-1) How to Load jQuery from the Google CDN

Load jQuery from the Google CDN for Wordpress Theme Fucntions

Just copy and past following codes to yourdomain.com/wp-content/themes/activated-theme/fucntions.php in the most below.
Example: PHP
// Even more smart jQuery inclusion :)
add_action( 'init', 'jquery_register' );

// Register from Google and for footer
function jquery_register() {

    if ( !is_admin() ) {

        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', ( 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' ), false, null, true );
        wp_enqueue_script( 'jquery' );
    }
}