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