Created
March 22, 2012 02:31
-
-
Save peterwilsoncc/2155237 to your computer and use it in GitHub Desktop.
Live reload WordPress extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: LiveReload | |
Description: Adds the JavaScript for LiveReload to a WordPress site | |
Version: 0.0.0.0.1alpha | |
Author: Peter Wilson | |
Author URI: http://peterwilson.cc/ | |
*/ | |
function pwcc_live_reload_js() { | |
?> | |
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script> | |
<?php | |
} | |
add_action('wp_footer', 'pwcc_live_reload_js') | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment