Wordpress Snippet: How To Load jQuery in the Footer | Tutorial Freak – Online Tutorials

WordPress Snippet: How To Load jQuery in the Footer

WordPress loads the jQuery javascript framework at the top of your files by default – this results in your site loading slowly.

Here’s a snippet to force WordPress to load jQuery in the theme footer which will result in your site loading fast and nice!

Just insert the below code in your wordpress functions.php file:

function ds_print_jquery_in_footer( &$scripts) {
	if ( ! is_admin() )
		$scripts->add_data( 'jquery', 'group', 1 );
}
add_action( 'wp_default_scripts', 'ds_print_jquery_in_footer' );

Share, like or comment if you find this post useful.

Author, Blogger, SEO Expert, Working Professional and a Student! I play so many roles in life and love what i do. I enjoy each moment of my life. Do follow us on Facebook

Sagar – who has written posts on Tutorial Freak – Online Tutorials.


Help keep us alive & kicking, we need coffee 24/7, please donate, thanks!
Embed

Leave a Reply

      
      
      
      
      
      
      
      
             
Save Now! $1.99 .COM at GoDaddy!
             
      
  • Free Webmaster Resources – February 2013