I currently have in my header.php:
<?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'header-large' ); ?>
<?php if ( has_post_thumbnail() ) { ?>
<div id="wrapper-navbar" itemscope itemtype="http://schema.org/WebSite" style="background-image: url('<?php echo $backgroundImg[0]; ?>');">
<?php } else { ?>
<div id="wrapper-navbar" itemscope itemtype="http://schema.org/WebSite">
<?php } ?>
Which sets the background image if there is a featured image on the pages and posts. If there is none then there is a fall back where I have a default background image.
My problem arises on the Blog page - The page which is set as the "Posts Page'
The background image displayed on the "Posts Page" is the featured image of the latest Post on the list, NOT the featured image I have set for the page.
How do I display the featured image of the Page and not of the latest post on the list?