• A site I have not touched for a few days is now completely broken as far as the CSS is concerned. The error generated on the server is this:

    Did not parse stylesheet at ‘http://www.mysite.com/wp-content/themes/twentyfourteenchild/style.css?b-modified=1481820305&ver=751d4e15546b157d8a65edb7e1afe76f’ because non CSS MIME types are not allowed in strict mode.

    I don’t have any idea as to what might be going on here. I reloaded a backup of the stylesheet in question – no joy.

    I have tried to enqueue both the parent and child’s CSS in the child theme’s functions.php file, with this code:

    function twentyfourteen_enqueue_styles() {

    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’, array( ‘genericons’ ) );
    wp_enqueue_style( ‘child-style’,
    get_stylesheet_directory_uri() . ‘/style.css’,
    array( ‘parent-style’ )
    );
    }
    add_action( ‘wp_enqueue_scripts’, ‘twentyfourteen_enqueue_styles’ );

    If I examine the site’s CSS now from the top page, the CSS file, twentyfourteenchild/style.css shows up in the code examination tool as completely different – it has the whole page’s code from the DocType declaration down! The only way I can get the child theme’s CSS to work is to paste it into the Theme Customize panel under CSS.

    • This topic was modified 9 years, 4 months ago by wpress2010. Reason: better code
Viewing 6 replies - 1 through 6 (of 6 total)
  • This is a known issue that will be fixed, it the mean time you can use https://ww.wp.xz.cn/plugins/disable-real-mime-check/

    Thread Starter wpress2010

    (@wpress2010)

    Ach, what a major nuisance! I just reloaded the site form a backup. Luckily, didn’t lose any content. Somehow, this issue is pretty much INVISIBLE on the Web. I didn’t find a single reference to it. Thanks so much for your help!

    Generally, when a site goes “funny” without anyone touching it, it’s either a server issue or something like this. The error message on the server was my only clue as to what the failure might have been caused by.

    Did your site automatically update to WordPress 4.7.1? I installed the update yesterday and my CSS fell apart on category and product pages. Trying to resolve but hitting a wall. Now trying to revert back to 4.7.

    Thread Starter wpress2010

    (@wpress2010)

    I have it set so that I update WP manually. But the 4.7.1 update was the cause, no question, as I had not been on the site in a few days.

    My web host automatically backs up everything once a day, so after I had figured out whathad happened, I just restored the previous day’s files and db, and I was back to normal.

    The automatic WP core update (the default WP behavior) seemed to me to be one of the worst “improvements” that WP ever dreamed up. There are, as you probably know, various ways to block it.

    • This reply was modified 9 years, 4 months ago by wpress2010. Reason: typos

    Glad you resolved it. One of the issues that arose was server-side caching of my style sheets, so no updates were appearing as I edited, even with force refresh and cache dumping through browser and Varnish. I can’t imagine why else that would have started immediately upon update to 4.7.1. I decided to keep the update and build code to resolve errors, since I’m pre-launch and if something is going to break, now is the time to deal with it. Anyway, spent a good while working on server-side caching issue. Found a clean piece of code that resolved it, now I’m able to get back to working on the actual design. The code timestamps the CSS file request so it can’t cache, and you only need to modify functions page. Not sure if it’s relevant to you, but here’s the link as it could help someone else: http://astronautweb.co/snippet/auto-version-css-load-after-plugin/.

    Thread Starter wpress2010

    (@wpress2010)

    Thanks – that’s a useful piece of code, for sure!

    I purposely have the auto updaters turned off on all of my WP sites. I only did so after installing Wordfence, which routinely reports when anything on the site has an outdated version running – whether it’s the WP core or just a plug. That way, I can manage what gets updated and what doesn’t, and yet still stay informed of the latest updates that might be available.

    I always have a look around the Web before updating the WP core – but didn’t see any cautionary info at all on the latest update – so I went ahead and installed it.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘CSS Broken’ is closed to new replies.