Snippets: Site-Wide Overlay Header Style and Page Header Background Image

// Enable overlay header site-wide
add_filter( 'wpex_has_overlay_header', '__return_true' );

// Overlay header style
add_filter( 'wpex_header_overlay_style', function( $style ) {
	$meta = get_post_meta( get_the_ID(), 'wpex_overlay_header_style', true );
	return $meta ? $meta : 'dark';
} );

// Change the page header style
add_filter( 'wpex_page_header_style', function( $style ) {
	return 'background-image';
} );

// Change the page header background image
add_filter( 'wpex_page_header_background_image', function( $image ) {
	return 'YOUR IMAGE URL';
} );

Snippet Type: PHP

Posted Under: Header

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