A
A
Alexey selftrips.ru2017-10-26 05:07:51
TinyMCE
Alexey selftrips.ru, 2017-10-26 05:07:51

TinyMCE Wordpress: How to set the style to be displayed when editing?

I prescribe my class in additional styles in the theme settings. I apply it to the tag When viewing the page, everything is displayed correctly, but nothing is visible in the editor. How can I make this style work in the editor as well? I don’t know if it’s relevant or not, but in the editor settings there is an empty checkbox<div class="moyclass">содержание</div>

Creating a CSS class menu
Load the CSS classes used in editor-style.css and replace the Formats menu.

In it is written
ERROR : Your theme does not support editor-style.css. To use this option, add editor-style.css to your theme or child theme. Enabling this option will also load the stylesheet into the editor.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zorca, 2017-10-26
@selftrips

Add to your theme's functions.php file:

function my_theme_add_editor_styles() {
  add_editor_style( 'editor-styles.css' );
}
add_action( 'current_screen', 'my_theme_add_editor_styles' );

And make a custom stylesheet for the editor:editor-styles.css

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question