[ad_1]
Hi @dahliasan,
This two functions do the same thing, block_header_area call the function block_template_part which call the function do_blocks
function block_header_area() {
block_template_part( 'header' );
}function block_template_part( $part ) {
$template_part = get_block_template( get_stylesheet() . '//' . $part, 'wp_template_part' );
if ( ! $template_part || empty( $template_part->content ) ) {
return;
}
echo do_blocks( $template_part->content );
}
Sorry, I should have elaborated a little. I haven’t tried, but I think something like this should work :
<html>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<?php
$block_header_part = get_block_template( get_stylesheet() . '//header', 'wp_template_part' );
$block_header = $block_header_part && ! empty( $block_header_part->content ) ? do_blocks( $block_header_part->content ) : '';
$block_content = do_blocks( '
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:post-content /-->
</div>
<!-- /wp:group -->'
);
?>
<?php wp_head(); ?>
</head>
<body>
<?php
echo $block_header;
echo $block_content;
?>
</body>
</html>Can you test that and tell me if it’s work ?
