Snippets: Conditionally Enable/Disable Overlay Header

// Enable everywhere
add_filter( 'wpex_has_overlay_header', '__return_true' );

// To enable dynamically use a function
function myprefix_has_overlay_header( $return ) {

    // Enable for all posts
    if ( is_singular( 'post' ) ) {
        $return = true;
    }

    // Return bool
    return $return;
    
}
add_filter( 'wpex_has_overlay_header', 'myprefix_has_overlay_header' );

Snippet Type: PHP

Posted Under: Header

All PHP snippets should be added via a child theme's functions.php file.