Functions.php code that only runs on localhost?

This is the corect answer

if ( $_SERVER["SERVER_ADDR"] == '127.0.0.1' ) {
    function livereload(){
    ?>
        // mycode
     <?php
    }
    add_action('headway_body_close', 'livereload');
}

Leave a Comment