Skip to content

Instantly share code, notes, and snippets.

@tomess
Created February 1, 2013 16:24
Show Gist options
  • Save tomess/4692338 to your computer and use it in GitHub Desktop.
Save tomess/4692338 to your computer and use it in GitHub Desktop.
Wordpress: Include jQuery into a Wordpress Theme
// Replace the URL with the location of what version of jQuery you want to use.
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
wp_enqueue_script('jquery');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment