Jquery on page
-
i want to embed the jquery glossary on my wordpress page..
This is my code in my function.php[ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]
<?php function my_init() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"); wp_enqueue_script('jquery'); wp_deregister_script('scroll'); wp_register_script('scroll', get_option("siteurl") . '/wp-content/themes/twentyeleven/js/scroll.js'); wp_enqueue_script('scroll'); wp_deregister_script('scrollTo'); wp_register_script('scrollTo', get_option("siteurl") . '/wp-content/themes/twentyeleven/js/jquery.scrollTo-min.js'); wp_enqueue_script('scrollTo'); } } add_action('init', 'my_init'); ?>
i can see the jquery on the view source page but it wont execute. Pls help?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Jquery on page’ is closed to new replies.