Archived topic
Change WP Text Editor Font Family or Size
7 replies · Started by Rohan Verma on October 4, 2020
Hi, guys. I'm using the classic editor and want to change the default font family and font size.
WordPress support isn't that communicative or fast enough. Kindly do something for this particular thing.
I've contacted Fonts Plugin | Google Fonts Typography developer for plugin support for the same and he said:
Theme Developers can control the output of the editor by adding an editor-style.css stylesheet to their theme folder - https://developer.wordpress.org/reference/functions/add_editor_style/
Please help. I have gone through plenty of same requests on this forum. Tom you should do something on it. Literally, get fade up with the tiny 12px font size and that Apple System/Georgia font family.
Hi,
I’ve contacted Fonts Plugin | Google Fonts Typography developer for plugin support for the same and he said:
Theme Developers can control the output of the editor by adding an editor-style.css stylesheet to their theme folder – https://developer.wordpress.org/reference/functions/add_editor_style/
Yes this is the way to go. If we want something to work on the editor, we must enqueue it for editor style's use.
You can refer to this answer: https://generatepress.com/forums/topic/how-to-show-custom-fonts-in-block-editor-gutenberg/
or this one for a more detailed answer: https://generatepress.com/forums/topic/uploading-a-nongoogle-font-to-gp-child-theme/page/2/#post-1464406
I'm asking for the classic editor. I don't use block editor or child theme.
Hi there,
try this plugin:
https://wordpress.org/plugins/tinymce-advanced/
You can change the editor styles from Settings > TinyMCE advanced
Already using this plugin. But changing font family or font size here also changes the front end look.
I don't want to change the font family and size every time I open text editor.
Hi there,
You'd need to do something like this: https://generatepress.com/forums/topic/how-to-call-editor-style-css-from-child-theme/#post-149083
Sorry. I didn't understand. And after putting the PHP to Snippets plugin, I can't see any changes. Do I need to set anything else?
I'm not using the child theme so put this add_editor_style( 'editor-style.css' )
You will need to use a child theme to do this: https://docs.generatepress.com/article/using-child-theme/
You will need to create an editor-style.css file with your necessary CSS, and add it to your child theme.
Then in your child theme functions.php file, you need to add this:
add_action( 'after_setup_theme', function() {
add_editor_style( 'editor-style.css' );
} );
This tells WordPress to load your editor-style.css file in the editor.