I have deployed a site from local to live and for some reason WordPress is not loading its core css files. Example: on localhost the homepage loads the following css files but they are missing on live:
I see that the Siteground Optimizer plugin is running. Try deactivating that plugin from your WordPress dashboard and see if the problem goes away.
If it does, you can reactivate the SG optimizer and then add the 2 css files as to the SiteGround Optimizer exclude list. This will prevent the 2 css files from being combined with others.
I am following this very closely as I seem to have the same issue.
Things I’ve tried: – check if the files exist; they do and can be accessed by direct url – try incognito mode and multiple browsers; did not work – try with original TT3 theme; same thing, core styles won’t load – looked for http vs https issues in the db; everything is https – looked at the browser Inspector Console; no errors there – looked at the Inspector Network tab; no errors there – disabled all plugins, I have Complianz and Gutenslider; made no difference – in my case, javascript scripts are included and work fine
It looks like some stylesheet files are simply not included in the <head> section. One thing I’ve noticed, some specific inline CSS is also skipped. Things like <style id=”wp-block-image-inline-css”> have some rules missing.
Edit: forgot to mention this is the only site in a Multisite installation. I cannot provide a production link, sorry.
This reply was modified 1 year, 3 months ago by notarealboy.
This reply was modified 1 year, 3 months ago by notarealboy.
It looks like your site is using Siteground’s Optimizer plugin. Their documentation shows that they have an option to combine all CSS files into just one single file.
It’s possible this optimization isn’t being applied when it comes to your localhost site, so that could explain why you still see the individual CSS files you mentioned being loaded there.
Combining CSS files can be somewhat helpful for optimization, however, with HTTP2 (which your site does use), that’s not nearly as important as it used to be.
If this combination of CSS files is causing you issues or you’d just prefer it’s not done, I think you could try disabling this option in the Siteground Optimizer plugin settings and see if that gets the individual CSS files loading for the live site.
Let me know how it goes. I’m happy to help further if needed!
Had this show up while doing internal testing on one of our plugins. Clearing the wp_core_block_css_files transient db entry forced WP to repopulate it and that got the stylesheets loading again properly. Something, somewhere, caused it to populate incorrectly it seems.
You’re brilliant, @kbat82 ! I was pulling my hair out trying to figure out what the heck was happening on one of my sites with this problem. Deleted the transient and it all worked fine after that.
I’m thinking this transient may need to be purged after every theme update…
This reply was modified 1 year, 3 months ago by andronocean. Reason: verb tense
Thank you so much @kbat82! This issue has plagued me for a while. Your fix worked like a charm. I wonder if this will somehow be addressed in upcoming releases.
Viewing 10 replies - 1 through 10 (of 10 total)
The topic ‘Core block stylesheets not loading’ is closed to new replies.