[WP]JavaScript to Footer

March 3rd, 2011 at 01:00am Jason 141 views

<?php
/*
Plugin Name: JavaScript to Footer
Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/footer-javascript
Description: This plugin automatically moves JavaScript code to page footer, speeding up page loading time.
Version: 0.4
Author: Vladimir Prelovac
Author URI: http://www.prelovac.com/vladimir
*/
 
// super easy way to move javascript to footer
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5);
 
?>

Entry Filed under: WordPress Tagged with:

Share This Post Share This Post SubscribePrint This Post Print This PostSave As PDF Save As PDF

Related Posts Hot Posts Hot Comments Hot Tags

      Leave a Comment

      Required

      Required, hidden

      Some HTML allowed:
      <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

      Trackback this post  |  Subscribe to the comments via RSS Feed


      Calendar

      March 2011
      MTWTFSS
      « Feb Apr »
       123456
      78910111213
      14151617181920
      21222324252627
      28293031 

      Sponsors

      Most Recent Posts