I have an FSE-related question
- I'm trying to add a font to the 2023 theme but it's not showing in Gutenberg editor.
- In theme.json, in the "settings.typography.fontFamilies" section, I added the following fontFamily definition:
{
"fontFamily": "Sarabun, sans-serif",
"name": "Sarabun",
"slug": "sarabun"
},
I realize that this doesn't import the actual font definition files (...woff2), but I think it should at least show "Sarabun" as an option in gutenberg when I edit a Paragraph block and select the "Typography > Font" dropdown.
Note - this does work when I do these steps on the 2022 theme.
QUESTION - Does anyone know why the font (eg "Sarabun") wouldn't be showing?
theme.json
gets cached for performance reasons so if you're not telling your WP install it's a dev or local environment it'll assume it's a production env and cachetheme.json
and ignore your changes. Also have you tried declaring the files to use?theme.json
when you switch.WP_DEBUG
is an ancient debugging constant, but a few major releases ago a new constant was added towp-config.php
that lets you hint to WordPress what kind of environment it's on, e.g. a local env, dev env, staging, production and WordPress will behave slightly differently depending on how it's set. By default it assumes it's a production site. It will even setWP_DEBUG
for you if you say it's a dev environment: developer.wordpress.org/advanced-administration/wordpress/…theme.json
the files you intend to use. Note though that you should not be modifying 2022 or 2023, you're meant to create child themes so that your changes aren't destroyed when those themes get updated and your modifications remain separate. Last thing you want is to have to redo them all again because you want features and changes in an updated version of the original like form blocks