- This topic has 7 replies, 4 voices, and was last updated 3 years, 5 months ago by Tom.
-
AuthorPosts
-
October 4, 2020 at 12:15 pm #1472041Rohan Verma
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.
October 4, 2020 at 2:43 pm #1472134ElvinStaffCustomer SupportHi,
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
October 6, 2020 at 3:12 am #1474290Rohan VermaI’m asking for the classic editor. I don’t use block editor or child theme.
October 6, 2020 at 4:56 am #1474433DavidStaffCustomer SupportHi there,
try this plugin:
https://wordpress.org/plugins/tinymce-advanced/
You can change the editor styles from Settings > TinyMCE advanced
October 6, 2020 at 11:02 am #1475037Rohan VermaAlready 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.
October 6, 2020 at 4:00 pm #1475440TomLead DeveloperLead DeveloperHi 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
October 7, 2020 at 6:06 am #1476369Rohan VermaSorry. 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' )
October 7, 2020 at 9:43 am #1476969TomLead DeveloperLead DeveloperYou 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. -
AuthorPosts
- You must be logged in to reply to this topic.