Presumably this file and file path exists on your server?
./assets/fonts/agaramondpro-italic-webfont.woff2
I’m not clear why you need to load json here but there are easier ways to accommodate for a custom font:
https://wpsites.net/genesis-tutorials/fonts-wordpress/
https://wordpress.org/plugins/custom-fonts/
Thread Starter
Judia
(@judia)
WordPress is using block themes that rely on theme.json rather than the old functions.php that the old themes relied on. From what I understand, they’ll be retiring the old themes soon. You can read about block themes here: https://developer.wordpress.org/block-editor/how-to-guides/themes/block-theme-overview/
I see. Well, the json you provided is valid.
Is this path and file on your server:
./assets/fonts/agaramondpro-italic-webfont.woff2
Thread Starter
Judia
(@judia)
Yes, it’s the correct file path. That’s why I’m confused about why the custom fonts aren’t showing up. Is it possibly a glitch with WordPress?
I’ve also been having issues getting custom font’s to load via the theme.json setup. Tried multiple different guides and instructions, but just can’t get it to load the custom fonts.
I came here via google. I can confirm that I successfully added two custom fonts to my website, and that they do show up in the frontend and in the site editor. All I did was upload the fonts to assets/fonts/myfontfolder/myfont.woff2 and add the corresponding lines in theme.json. However, it stopped working for me when I tried adding a third font. I am confident that only those two changes made the fonts show up, so right now I am confused. But I think this info is useful for you guys. If I find a solution I will come back and write a reply.