Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ryandjohnson

    (@ryandjohnson)

    I’m under a bit of a deadline, so I’m afraid I can’t provide much info at the moment. I ended up just reinstalling TT3 and then editing my child theme manually.

    I should have saved a copy of the old theme.json and diff’d them, but I’m afraid I did not. I added a list under settings/typography/fontFamlies with the custom fonts I needed and the CSS is being generated to the child theme’s path as expected, based on src like file:./assets/fonts/Montserrat-VariableFont_wght.woff2.

    One thing I noticed is that the way the child/parent theme.json are merged, the settings/typography/fontFamilies list from the child completely replaces the one in the parent. So the font families from TT3 no longer appear in the block editor. The theme.json v2 “living reference” doesn’t have any details about how child theme.json entries are merged with the parent’s, so no idea if this is by design or a bug.

    In any case, that’s ok for my scenario. I just duped the “system font” entry from TT3 so it would still be available in addition to the google fonts I added, i.e.

    child/theme.json:settings/typography/fontFamilies:
    ...
    
    {
            "fontFamily": "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif",
            "name": "System Font",
            "slug": "system-font"
    }
    
    ...

    A word of caution to anyone editing the theme.json file by hand, it does not use JSON5 conventions and is very strict on the input, so if you have an additional trailing comma, for example, your theme won’t load and you will just get a not-very-helpful “PHP Notice: Error when decoding a JSON file” message in your WP_DEBUG log.

    • This reply was modified 1 year, 5 months ago by ryandjohnson.
    • This reply was modified 1 year, 5 months ago by ryandjohnson.
    Thread Starter ryandjohnson

    (@ryandjohnson)

    Based on this thread, I believe this is expected behavior, I was just looking for confirmation. As with other deep theme customization, a child theme is necessary to allow updates to the parent theme.

    That’s not a surprise, since it does appear that this plugin directly modifies the theme rather than having it’s own separate config that it’s applying dynamically.

    I was just looking for confirmation, since I was surprised to find that it would let me add fonts directly to twentytwentythree at all — since that is clearly inadvisable and is just going to lead to tons of support threads like the one I linked and now this new, similar one.

    Unfortunately, I am having trouble getting this plugin to work with child themes, as it correctly puts the font files in the child theme but the generated CSS path for the font still refers to the parent theme path for some reason. Not sure if it’s a problem with this plugin, twentytwentythree, or wordpress itself.

    Thread Starter ryandjohnson

    (@ryandjohnson)

    Hi, @roxannestoltz

    I should have mentioned I tried that, too. If you follow your link and click the “Let’s Go” button on the page, there’s a Slack error. I just figured the Slack wasn’t being used any more.

    The error is:

    [slack logo]

    This link is no longer active

    To join this workspace, you’ll need to ask the person who originally invited you for a new link

    Thread Starter ryandjohnson

    (@ryandjohnson)

    Hi, @danndumia

    Thanks. I had already looked at CONTRIBUTING, but it does not talk about contributing to documentation. That’s how I ended up here.

    How can I make contributions or suggestions to github project wiki that I linked? Pull requests don’t work for wiki pages.

    Is there something else you’d suggest I do in this situation? It is frustrating trying to use an API with an undocumented precondition, so I’d like to make that better for future users.

Viewing 4 replies - 1 through 4 (of 4 total)