# Make the Editor Match Your Classic Theme

> Loads an editor-style.css file from your (child) theme into the block editor and turns on editor styles, so posts look the same while writing as on the site.

- Type: PHP
- Runs: Run everywhere
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: classic-themes, editor, css
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/classic-theme-editor-styles/

## Code

```php
// File name inside the active theme folder.
$wpide_editor_style_file = 'editor-style.css';

add_action( 'after_setup_theme', function () use ( $wpide_editor_style_file ) {
    if ( wp_is_block_theme() ) {
        return;
    }

    if ( ! file_exists( get_stylesheet_directory() . '/' . $wpide_editor_style_file ) ) {
        return;
    }

    add_theme_support( 'editor-styles' );
    add_editor_style( $wpide_editor_style_file );
}, 20 );
```

## Notes

Create editor-style.css in your theme folder with the typography and colors you want in the editor. Block themes do this automatically.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Make the Editor Match Your Classic Theme" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
