• I have created a child theme of 2023 Default WordPress theme. Previously the custom font features works just fine. But on my new website I can’t add custom font from the child theme.

    Is there anyone facing the same issue?

    Here is the theme.json fonts code:

    {
    	"version": 2,
    	"$schema": "https://schemas.wp.org/wp/6.3/theme.json",
    	"settings": {
    		"typography": {
    			"fontFamilies": [
    				{
    					"fontFace": [
    						{
    							"fontFamily": "Montserrat",
    							"fontStretch": "normal",
    							"fontStyle": "normal",
    							"fontWeight": "700",
    							"src": [
    								"file:./assets/fonts/montserrat-bold.woff2"
    							]
    						}
    					],
    					"fontFamily": "\"Montserrat\", sans-serif",
    					"name": "Montserrat",
    					"slug": "montserrat-bold"
    				}
    			]
    		}
    	}
    }
Viewing 1 replies (of 1 total)
  • Hey @riadmahmud46 ! I tried generating a child theme with this font, using the Create block theme plugin, and the generated theme.json seems a little bit different. Can you try changing the following part

    "fontFamily": "\"Montserrat\", sans-serif",
    "name": "Montserrat",
    "slug": "montserrat-bold"

    To this:

    "fontFamily": "Montserrat",
    "slug": "montserrat-bold"
Viewing 1 replies (of 1 total)
  • The topic ‘2023 Child theme.json file custom font is not working’ is closed to new replies.