phpwordpressxamppnpm-live-server

Live changes Wordpress


I'm looking for something like npm live-server, that refreshes my webbrowser every time I make changes to a document. Npm live-server doesn't work with PHP files.

Currently using XAMPP Apache/MySQL to run WP locally.

Any ideas?


Solution

  • For the one's that are interested: here is the final solution. (Big thanks to @Kintamasis )

    1. Install Gulp / Gulp BrowserSync

    2. Create a gulpfile.js in your themes' folder.

        var gulp        = require('gulp');
        var browserSync = require('browser-sync').create();
        
        gulp.task('browser-sync', function() {
            browserSync.init({
                proxy: "YOUR PROXY HERE"
            });
        
            gulp.watch("*").on('change', browserSync.reload);
        });
    
    1. Run gulp browser-sync in your WP theme folder.