Custom header Image for each page

Hi.

I’m trying set the featured image for each page, but didn’t work.
I need set thumbnail like a custom header image. Is it possible?

I changed inc/custom-header.php lines:

if ( get_header_image() && ( get_theme_mod('front_header_type') == 'image' && is_front_page() || get_theme_mod('site_header_type', 'image') == 'image' && !is_front_page() ) ) {
	?>
	<style type="text/css">
		.header-image { background-image: url(<?php echo get_header_image(); ?>);
			display: block;
		}
	</style>

I tried set
get_header_image ('featured_image');
$thumbnail;
and similar but not working. Can you help me?

Hi,

We don’t usually provide help for this sort of changes but what you’re looking for is the_post_thumbnail();

It works, Thanks :slight_smile:

Changes:

function sydney_header_style() {

	if ( the_post_thumbnail() && ( get_theme_mod('front_header_type') == 'image' && is_front_page() || get_theme_mod('site_header_type', 'image') == 'image' && !is_front_page() ) ) 
{ ?>
	<style type="text/css">
		.header-image { background-image: url(<?php echo the_post_thumbnail(); ?>);display: block; }

	</style>
	<?php
	}
}
endif; // sydney_header_style

Cool.
To check if a featured image is present you should use has_post_thumbnail().
Ratings are appreciated :slight_smile: