Unload templates; disable parent Template Parts using only “theme.json”

Does anyone have any suggestions on how to disable certain template parts in a child theme using theme.json in WordPress with Gutenberg? Using only theme.json this is not possible, and runs counter to the vision for full site editing. In the future it’s possible that not only the parent theme templates might be visible, but … Read more

theme.json is altering Group block HTML

I was able to prevent the unwanted altering of HTML by using the render_block_core/group filter, and a copy of wp_restore_group_inner_container, without the JSON support check. public static function my_add_block_group_inner( $block_content, $block ) { $tag_name = isset( $block[‘attrs’][‘tagName’] ) ? $block[‘attrs’][‘tagName’] : ‘div’; $group_with_inner_container_regex = sprintf( ‘/(^\s*<%1$s\b[^>]*wp-block-group(\s|”)[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|”)[^>]*>)((.|\S|\s)*)/U’, preg_quote( $tag_name, “https://wordpress.stackexchange.com/” ) ); $replace_regex = sprintf( ‘/(^\s*<%1$s\b[^>]*wp-block-group[^>]*>)(.*)(<\/%1$s>\s*$)/ms’, … Read more

Is there a way to add background-image to theme.json?

Background image in theme.json is not yet supported In your theme.json file, you can define a CSS class name for the element that you want to add the background image to. For example: “styles”: { “hf-bg”: { “backgroundColor”: “#ffffff” } } In this example, we’ve defined a style called hf-bg that sets the backgroundColor property … Read more

theme.json should be in the child theme folder when using xxxx.json style located in the styles folder?

Short answer: No Long answer: The child themes theme.json will simply use the TT3 theme.json values if a specific value is not found. So you can make a new theme.json file only with the specific values needed for the child theme. An excellent writeup is available here: https://kinsta.com/blog/twenty-twenty-two-theme/#extending-twenty-twentytwo-with-a-child-theme