Part

This block type renders a template part by the provided path.

Parameters

  • path - the PHP file path, without the extension and relative to the templates subdirectory of HivePress or its extensions.

Example

The code below renders the no-results-message.php file from the templates/page HivePress subdirectory, this template part contains the "Nothing found" message.

echo ( new HivePress\Blocks\Part(
	[
		'path' => 'page/no-results-message',
	]
) )->render();

Last updated