• I can see in the release notes theme.json is now included however there is literally zero documentation on how we should treat what is potentially a significant addition. Are we safe to change this for example? Will it be respected or would it need to be via a child theme?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Chito

    (@chitocamacho)

    Hi @antonyjosephsmith,

    Apologies for the lack of documentation regarding this change.

    Before the update, there were missing options in the Gutenberg Group block when using the Kadence theme. Adding the theme.json file adds support to core blocks (changes to group block markup).

    You can turn on/off this in Customizer > General > Performance > Enable Optimized Group Block.

    It’s safe to enable this option, and it does not need a child theme.

    Please let us know how we can assist further.

    Best,
    Chito

    Thread Starter antonyjosephsmith

    (@antonyjosephsmith)

    If you could answer my questions too that’d be much appreciated.

    Thanks!

    Hi Antony,

    The theme.json file is a new addition starting with version 1.2.0 to add support to core blocks. The documentation team is working on adding this to the documentation. As of now, you can see it on the changelog file: https://www.kadencewp.com/kadence-theme/changelog/

    We appreciate your continued patience and understanding with this.

    If you were to directly edit your theme.json file, then that would be overwritten in a theme update.

    If you do want to directly edit your theme.json file, I would suggest making a child theme.

    You can also submit a support ticket via these channels.

    If you need further assistance, please don’t hesitate to reach out to us again and open a new ticket.
     
    Kind Regards,
    Michael Taro

    Hey @antonyjosephsmith, what are you interested in changing or doing differently with a theme JSON file?

    The main thing with this change in the theme is to better support enhancement to core WordPress blocks that are only enabled if you have a theme json file. For example the group block has options for a background image but only if the theme is using a theme json file.

    Docs are coming, but to enable a child theme JSON file, you need to go to customizer > general > performance and enable “Enable Optimized Group Block”.

    Ben

    Thread Starter antonyjosephsmith

    (@antonyjosephsmith)

    Thanks for the info Ben,

    I’m just wanting to change some of the defaults in the core WordPress blocks so they work better with the sites I build for clients.

    Most of the time it’s gonna be fairly simple stuff like the margins on the Heading block or colour defaults on Quotes etc

    I’ve tried toggling that setting and the background image option shows up in the group block if it’s enabled or not, I can’t really see that is makes a difference!

    Plus any changes I make to either the theme.json file in Kadence or via a child theme seem to have zero effect, is this to be expected? Just seems weird that there’s a bunch of properties in there that don’t do anything.

    In order to provide backward compatibility with people using custom css specific to the group block markup (which is a totally different markup if using a theme json file) we disable the theme json by default and still allow for theme json settings to be applied using a filter : wp_theme_json_data_theme

    That way you won’t see a difference in the editor with regard to the group block but on the front end the group block markup will be totally different because if the setting is enabled then the theme json file is enabled, if the setting is not enabled then the filter runs to add theme json settings.

    I can’t recreate an issue where settings are not being applied from the theme json if you have the setting I mentioned enabled. Can you send me the exact settings you are adding?

    Ben

    Thorworx

    (@thorworx-1)

    Ben,

    If the group block setting is enabled, can a child theme’s theme.json file simply include additions/overrides? Or does it need to be a complete formatted theme.json including copied kadence theme.json, schema, etc?

    It would seem that it should work the same way as a child theme style.css or functions.php – (using overrides only) but the formatting is going to be important. An example commented child theme.json would be appreciated.

    {
    	"version": 2,
    	"settings": {},
    	"styles": {},
    	"customTemplates": {},
    	"templateParts": {}
    }
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘theme.json in 1.2.0’ is closed to new replies.