Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Forked from peterwilsoncc/livereload.php
Created October 21, 2013 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iloveitaly/7088467 to your computer and use it in GitHub Desktop.
Save iloveitaly/7088467 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: LiveReloadSimple
Description: Adds the JavaScript for LiveReload to a WordPress site
Version: 1.0
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