Websnippetz

Get cool snippets on php, css, jQuery, Magento and wordpress

Loading jQuery from the Google CDN

<br />// even more smart jquery inclusion :)<br /> add_action( 'init', 'jquery_register' );// register from google and for footer<br /> function jquery_register() {<br />     if ( !is_admin() ) {<br />         wp_deregister_script( 'jquery' );<br />         wp_register_script( 'jquery', ( 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' ), false, null, true );<br />         wp_enqueue_script( 'jquery' );<br />     }<br /> }<br />

karthi s

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: