• I’m in the theme editor. I’ve selected the Style editor (half-moon icon) in top right. I’ve clicked ‘Typography.’ I have three options, “System Font,” “Default,” or “Source Serif Pro.”

    I know I can go into the stylesheet (I’ve generated a Child theme of this) and change the global settings there, but is there a way to get my site fonts to show in this drop-down?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • You have to “register” them in the theme JSON file so that the theme will list them in that drop down menu.

    Open the theme.JSON in an editor, and then search for the word “font” and you will work your way through some of the font settings. Eventually, you will come across a section where the fonts from that drop down you are looking at are “registered” as options in the drop down menu. It will make more sense when you see it!

    This is where you can make what you want to have in the drop down menus show up once you copy a little code and customize it for your font groups

    @saturn3

    Hi there,

    Any chance you can expand on that answer, with some practical code samples?

    I have been trying to accomplish just that (editing theme.json to register google fonts stored locally in assets/fonts) – and I just cannot get it to work.

    All I achieve is the loss of the drop-down list completely.

    Any help from anyone would be very much appreciated.

    Thanks,
    Carl

    @saturn3

    Ooops!, It’s OK – I figured it out!

    I had left a comma in the code after a square bracket, right where it shouldn’t have been – all good now…

    For reference, here is the code I inserted:

    
    {
    					"fontFamily": "\"Archivo Black\", sans-serif",
    					"name": "Archivo Black",
    					"slug": "archivo-black",
    					"fontFace": [
    						{
    							"fontFamily": "Archivo Black",
    							"fontWeight": "200 900",
    							"fontStyle": "normal",
    							"fontStretch": "normal",
    							"src": [ "file:./assets/fonts/Archivo Black/ArchivoBlack-Regular.woff2" ]
    						}
    					]
    				},
    

    As mentioned, this goes in the theme.json file, scroll down to :

    
    "typography": {
    			"dropCap": false,
    			"fontFamilies": [
    

    Make sure you have your fonts in your assets/fonts folder, and double check you don’t have an extra comma’s…. ??

    Hope this helps someone else…

    Carl.

    OK awesome! Glad you worked it out.

    You did this after the 6.0 upgrade, yes? And/or after the Twenty Twenty Two update to 1.2? (I think that is new version number, I am not at a computer)

    Yes,

    WordPress 6.0
    Twenty Twenty-Two 1.2

    Carl

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changing global fonts via theme editor’ is closed to new replies.