• Posted: 2012-08-02
  • Author: Dominik Schilling
  • Tags:

Load jQuery in footer

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
<?php
/**
 * Prints jQuery in footer on front-end.
 */
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' );

?>

Instructions:

By default WordPress has registered the jQuery library to load in the header.

This snippet changes this behaviour.


Related links:
http://wpgrafie.de/schnipsel/jquery-footer-wordpress/
Share this snippet

If you like this snippet, share it with friends!