Site logo

[Resolved] How to call editor-style.css from child theme?

Home Forums Support [Resolved] How to call editor-style.css from child theme?

Home Forums Support How to call editor-style.css from child theme?

Viewing 16 post (of 16 total)
  • Author
    Posts
  • #2138964
    mkjj

    This is a pretty old post, but I would like to add a useful snippet after having some problems with the editor-style-css. Sometimes, you can’t really see whether the custom styles are loaded or not due to the browser cache. This can get very ennerving, since even deleting the browser cache won’t work. I use this workaround that adds a timestamp to the CSS file:

    add_editor_style(get_stylesheet_directory_uri() . '/editor-style.css?v=' . filemtime(get_stylesheet_directory() . '/editor-style.css'));
    

    After modifying the file, the timestamp will change and the effects will show immediately.

    Took me some time to figure this out. I still don’t know why the WordPress editor seems to work differently compared to a standard website.

Viewing 16 post (of 16 total)
  • You must be logged in to reply to this topic.