/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
------------------------------------------------ This must be inserted into the functions.php file: function modify_jquery() { if (!is_admin()) { // comment out the next two lines to load the local copy of jQuery wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js', false, '1.6.1'); wp_enqueue_script('jquery'); } } add_action('init', 'modify_jquery'); ------------------------------------------------ This must be inserted into the header.php file (BEFORE WP_HEAD CALL!): <?php wp_enqueue_script("jquery"); ?> ------------------------------------------------ jQuery functions should be wrapped in this so that $ operator represents no-conflict (BELOW WP_HEAD): <script type='text/javascript'> jQuery(document).ready(function($) { // $() will work as an alias for jQuery() which is noconflict mode inside of this function }); </script> ------------------------------------------------