• Resolved therobgregory

    (@therobgregory)


    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:

    • /wp-includes/blocks/navigation/style.min.css?ver=6.3
    • /wp-includes/blocks/cover/style.min.css?ver=6.3

    Have tried deactivating all plugins and also using the Twenty-Twenty-Three theme but cannot get the css files to load.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Do the files exist on the live site? If so, possibly re-upload fresh core WordPress files and see if that corrects the issue.

    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.

    Hi @therobgregory,

    I took a look at the CSS files being loaded for the page you mentioned, and I only see this one:

    https://caslweb.magnifica-online.co.uk/wp-content/uploads/siteground-optimizer-assets/siteground-optimizer-combined-css-d0f60c7921fe4b04a701639003ad3a8a.css

    View post on imgur.com

    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.

    FYI the site wasn’t using SG’s plugin

    Thank you so much for suggesting this, @kbat82! I was nowhere close to solving it. You’re my hero. Indeed, deleting the

    _transient_wp_core_block_css_files

    entry from the wp_options table solved the styles issue for me!

    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
    Thread Starter therobgregory

    (@therobgregory)

    Thank you @kbat82 – that fixed it👍

    Thank you, thank you, thank you @kbat82 you’re a freaking hero

    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.