Skip to content

Snippet: Replace Site Header With WPBakery or Other Template Content

IMPORTANT: In Total 3.5.2 we added a new "Header Builder" function. Simply go to Theme Panel > Header Builder to replace your header with content from any page!

// Override the site header with a custom template.
add_filter( 'wpex_header_template_id', function( $id ) {
	return 'YOUR_TEMPLATE_ID';
} );

// Remove header section from the customizer to prevent confusion.
add_filter( 'wpex_customizer_sections', function( $sections ) {
    unset( $sections['wpex_header'] );
    return $sections;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top