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 block template part to print, for example 'header' or 'footer'.
    Required: Yes
Defined at:
Codex:

Prints a block 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 );
}