Skip to content

Instantly share code, notes, and snippets.

@Pushplaybang
Created August 28, 2012 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pushplaybang/3502144 to your computer and use it in GitHub Desktop.
Save Pushplaybang/3502144 to your computer and use it in GitHub Desktop.
wordpress function to correctly load jquery
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_register_script('bangplugs', get_template_directory_uri().'/js/bang-plugins.js');
wp_register_script('bangscripts', get_template_directory_uri().'/js/bang-scripts.js');
wp_enqueue_script('jquery');
wp_enqueue_script('bangplugs');
wp_enqueue_script('bangscripts');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment