This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'maybe_load_jquery_from_google', 1 ); | |
function maybe_load_jquery_from_google() { | |
// do not load in wp-admin | |
if( is_admin() ) | |
return; | |
// Load from SSL if necessary | |
$protocol = is_ssl() ? 'https:' : 'http:'; | |
$url = $protocol . '//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js'; |