Archived topic
Local Fonts in Editor - Stumped
5 replies · Started by Mat on November 28, 2022
Have genuinely tried everything to get this working. Was building site with lots of Snippets, including for CSS so that we had area-specific style sheets. In case that was the issue, I got rid of them all and dumped them and the @font-face calls back into simple.css.
Have added this snippet:
add_filter( 'block_editor_settings_all', function( $editor_settings ) {
$css = wp_get_custom_css_post()->post_content;
$editor_settings['styles'][] = array( 'css' => $css );
return $editor_settings;
} );
Still nothing showing when editing pages. Grateful for a pointer here - all info in Private section. Thanks.
*** Edited to add: please feel free to take over editing if example page shows somebody else editing. This is a dev server, do whatever you need!
Hi there,
The snippet you are using is to load the CSS from the customizer > additional CSS field.
Can you try adding the CSS in the customizer?
I supplied an Admin login for this reason - all CSS, including font-face stuff, IS all in the customiser. It wasn't before but I moved everything and it's still not working.
Thanks.
You don't have anything in your additional CSS field:
https://www.screencast.com/t/5YorV51p4
Please add the @font-face CSS in the additional CSS field.
Well, every day is an egg-on-face day, or something like that.
Of course that has fixed it but, I have never used 'Additional CSS', rather 'Simple CSS' via Tom's plugin. Always assumed it was a case of either/or as they were both inside Customiser. Evidently not.
Thanks
Additional CSS is WP's default CSS inputting area.
As for the simple CSS, Tom has stopped supporting or updating it, but it still works.