Skip to content

Snippet: Conditionally Enable/Disable Overlay Header

Important: You can now enable the Transparent/Overlay header globally in the Customizer as well as conditionally enable/disable it in the Customizer. This example snippet is specifically if you need to conditionally enable the overlay header via more advanced means.
// Enable the overlay header for pages.
add_filter( 'totaltheme/header/overlay/is_enabled', function( $return ) {
    if ( is_singular( 'page' ) ) {
        $return = true;
    }
    return $return;
} );
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