Load Beans secondary template file.

This function loads Beans’s default template file. It must be called from a secondary template file (e.g. comments.php) and must be the last function to be called. All modifications must be done before calling this function. This includes modifying markup, attributes, fragments, etc.

The default template files contain the hook on which the fragments are attached to. Bypassing this function will completely remove the default content.

beans_load_default_template( string $file )

Return: (bool) False if file isn't found.


$filestringtrue-The filename of the secondary template files. __FILE__ is usually to argument to pass.


function beans_load_default_template( $file ) {

	$file = BEANS_STRUCTURE_PATH . basename( $file );

	if ( ! file_exists( $file ) ) {
		return false;

	require_once( $file );