Created
August 28, 2012 18:47
-
-
Save Pushplaybang/3502144 to your computer and use it in GitHub Desktop.
wordpress function to correctly load jquery
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
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