Ever run into CSS or JS failing to load when working on a WordPress project locally? Me too!!! I even tried a fresh install using MAMP, but still got intermittent issues. It was driving me nuts until I did a little googling and found what the problem was.
If you’re seeing something like what’s shown above, you’re probably having the same issue I was with the
load-styles.php files. I was surprised to see on a fresh install of WordPress, console was returning a bunch of CSS and JS errors. I took a look at one of the problem files, load-scripts.php from the console and found:
Yikes! Initially I thought my install got corrupted somehow, so tried to re-installing WordPress again with no luck. After digging around, I finally found a solution.
wp-config.php, add the following:
define( 'CONCATENATE_SCRIPTS', false );
1 comment on “Fix WordPress CSS & JS From Breaking”.
# Aug 28, 2018
thanks man you saved me lots of trouble <3
All comments posted on 'Fix WordPress CSS & JS From Breaking' are held for moderation and only published when on topic and not rude. Get a gold star if you actually read & follow these rules.
You may write comments in Markdown. This is the best way to post any code, inline like `<div>this</div>` or multiline blocks within triple backtick fences (```) with double new lines before and after.
Want to tell me something privately, like pointing out a typo or stuff like that? Contact Me.