I am working on a site and each page group has its own featured image. I am trying to do a conditional statement in the header but not sure how to check for the parent page's featured image.
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
} else{?>
<img src="<?php bloginfo('template_url')?>/images/BANNER-DEFAULT.jpg"/>
<?php
}
?>
I want it to preform like:
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
}
if ( ?????? { // check if the parent page has a Post Thumbnail assigned to it.
the_post_thumbnail();
}else{?>
<img src="<?php bloginfo('template_url')?>/images/BANNER-DEFAULT.jpg"/>
<?php
}
?>
Can anyone help with this? I am also considering calling in the banner on the page templates and not the header, but I still need a way to call in the featured image on the Parent Page.