Support » Fixing WordPress » WordPress 4.8 editor “Failed to load content css”

  • Resolved wp_kc

    (@wp_kc)


    After updating to WordPress 4.8, editing a post causes a floating error message to appear at the top of the editor saying that it could not load the theme’s editor-style sheet. The message says, “Failed to load content css: https://mydomain.com/wp-content/themes/mytheme/assets/css/editor-style.css

    Setup:

    • WordPress 4.8 on Ubuntu w/ Apache2
    • Twentyseventeen theme installed
    • Using child theme of Twentyseventeen.
    • The file mentioned above does exist.
    • The child theme was working fine and did not produce this error before the update of WordPress and the Twentyseventeen theme.
    • The strangest part is that I can confirm that the css file in question is being downloaded by the browser and is having an effect on the editor. The actual URL being generated by WP is: https://mydomain.com/wp-content/themes/mytheme/assets/css/editor-style.css?wp-mce-4603-20170530
    • This is the editor style code in my child theme’s functions.php file:
      function child_theme_setup() {
          add_editor_style(array(
              get_stylesheet_directory_uri() . '/assets/css/editor-style.css',
              child_theme_fonts_url()
          ));
      }
      
      add_action('after_setup_theme', 'child_theme_setup', 99);
Viewing 15 replies - 16 through 30 (of 33 total)
  • Same problem. Can I just ignore it?

    Moderator Marius L. J.

    (@clorith)

    The problem won’t hinder your use, but it’ll obviously get frustrating, so I’d highly recommend reaching out to your theme developer and asking them to look into fixing it 🙂

    Hello all, I think I have the same problem but I’m not a technical developer. I get the following error. Failed to load content css https://jouwscriptiecoach.nl/wp-content/plugins/wordpress-seo/css/inside-editor-490.min/fonts.googleapis.com/css?family=Poppins.

    I do not know what went wrong here and if it’s a problem of the developer op the theme (ucode bij Envato). Hopefully you can help me out by giving me instructions how to take care of this. Thanks!

    Moderator Marius L. J.

    (@clorith)

    Hi @lindahovestad, this is a problem your theme developers need to address, they’ve added a font link incorrectly, and since it can’t be loaded you are seeing the error above.

    Check for an updated version of your theme, if not reach out to the theme developers and tell them that their editor styles have an error and are causing warnings in WordPress 4.8

    (As a side note, I’ve removed your other topic, since we covered it here 🙂 )

    Same same:

    Failed to load content css: https://www.solarelectrique.com.au/wp-admin/admin-ajax.php/?action=dynamic_styles

    From reading this thread I’m assuming this is abug in 4.8 as it has also been happening for me since the update.

    Same bug here, i don’t understand why.

    In lib.php (included in functions.php), i have:

    add_action('after_setup_theme', function () {
      ...
      add_editor_style(get_template_directory_uri('dist/editor.styles.css'));
      ...
    }, 20);

    it is supposed to load httpdocs/app/themes/wp-starter2017/dist/editor.styles.css

    the editor.styles.css is built with webpack2 and contains at the moment only:

    body{background-color:#f39}
    /*# sourceMappingURL=editor.styles.css.map*/

    No @import or whatever else.

    In the network tab, i have HTTP 500 error on the file http://wp-starter2.test/app/themes/wp-starter2017/?wp-mce-4603-20170530, if i comment add_editor_style, this error disappears.

    Hi,

    Since the upgrade to WP 4.8, I have the same problem in editing the articles and pages of the dashboard of my blog
    “Failed to load content css: https://fonts.googleapis.com/css?family=Allura%2C

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Thank you,

    But I don’t have a child theme … and the theme I use is a native wordpress theme (twentyfourteen)

    Else, the problem is on backend. So the theme is not use…

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    This may be a plugin or theme theme. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles. WordPress does not use external fonts on the back-end.

    Ok, I found the plugin involved …
    But my problem is that this plugin is no longer updated (and removing it from my blog would cause malfunctions) …
    Here are the codes I found that seem to be related to the problem:

    Function opl_get_googlefonts () {
    Return array (
    ‘Allura’ => ‘cursive’,

    And:
    @import url (// fonts.googleapis.com/css?family=Open+Sans+Condensed:700);
    @import url (// fonts.googleapis.com/css?family=Exo:900);

    Would there be a code that would no longer be supported? And if so, what should I change?

    Thank you for your help

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    What I see is that Google does not have (or no longer has) the Allura font.

    You can easily add Google fonts via a simple function in your theme’s functions.php

    function sds_google_fonts() {
       wp_enqueue_style( 'google-fonts', 'https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i|Montserrat:400,400i,600,600i' );
       }
    add_action( 'wp_enqueue_scripts', 'sds_google_fonts' );

    You don’t really need a plugin for Google fonts.

    Thank you
    But the problem is not with my theme but with backend… and this plugin do a lot of think, not only add fonts…
    And what surprises me is that, like many other users, it worked well before the upgrade of wordpress …

    And Google have Allura font : http://fonts.googleapis.com/css?family=Allura

Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘WordPress 4.8 editor “Failed to load content css”’ is closed to new replies.