add_editor_style() does not seem to be implemented properly.

While developing WordPress theme you see the message:

RECOMMENDED: add_editor_style() does not seem to be implemented properly.

The reason is your themes style.css load ONLY ON front end.
So, While writing article end user not have an idea how it looks on front end.


# Why editor style is recommended?

The reason is end user does not

The reason of editor style is to Show the post design / look in post editor window!


# How it editor style works?

Check below example to know how editor style works.

E.g. If your single post design is look like below screenshot:

frontend


With editor style support:

with-editor-style

Without editor style support:

without-editor-style


# Add editor style support?

/**
 * Added Editor Style
 */
function _theme_slug_setup() {
     add_editor_style( 'editor-style.css' );
}
add_action( 'after_setup_theme', '_theme_slug_setup' );

# Add RTL Support for Editor Style

For editor style RTL support! Save the file with FILE_NAME-rtl.css

E.g. editor-style.css then editor-style-rtl.css
E.g. assets/inc/editor-style.css then assets/inc/editor-style-rtl.css

Advertisements

Author: maheshwaghmare

WordPress Developer since 2012

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s