wpseek.com
A WordPress-centric search engine for devs and theme authors



block_template_part › WordPress Function

Since5.9.0
Deprecatedn/a
block_template_part ( $part )
Parameters:
  • (string) $part The template-part to print. Use "header" or "footer".
    Required: Yes
Defined at:
Codex:

Print a template-part.



Source

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 );
}