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

Snippet Type: PHP

Posted Under: Header

All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)