editor-styles
-
Hi,
I followed the suggestions to add a stylesheet for the block editor; I’m specifically interested in getting it to look a little closer to the actual theme, like font-family. But none of the suggestions work. I tried each of the below individually. The last one from the codex gave a fatal error. I’m using a basic Underscores theme, wp 5.8. Any help?// Add support for editor styles. add_theme_support( 'editor-styles' ); // Enqueue editor styles. add_editor_style( 'style-editor.css' );
//
add_action( ‘after_setup_theme’, ‘cpm_setup’ );
function my_theme_setup() {
add_editor_style(‘style-editor.css’);// For the Block Editor.
add_theme_support( ‘editor-styles’ );
}//
function add_editor_style( $stylesheet = ‘editor-style.css’ ) {
global $editor_styles;add_theme_support( ‘editor-style’ );
$editor_styles = (array) $editor_styles;
$stylesheet = (array) $stylesheet;if ( is_rtl() ) {
$rtl_stylesheet = str_replace( ‘.css’, ‘-rtl.css’, $stylesheet[0] );
$stylesheet[] = $rtl_stylesheet;
}$editor_styles = array_merge( $editor_styles, $stylesheet );
}The page I need help with: [log in to see the link]
- The topic ‘editor-styles’ is closed to new replies.