Archived topic
updating the header in the posts page
7 replies · Started by eric on October 2, 2019
Hi there,
I've updated the header.php file to create my own banner throughout the site I'm working on. It works as intended on all pages except one.
One the posts page (assigned on the settings, reading page), it pulls up the image and title of the first POST, instead of the pages title and featured image. Is there an easy way to change this? Thanks in advance.
global $post;
if (!is_page_template( 'SDhome.php' ) ) {
if ( has_post_thumbnail() ) {
echo '
$featured_image = get_the_post_thumbnail_url($post, 'hero-image' );
$title = get_the_title();
echo '
echo $title;
echo '
';
echo '<div class = "hero" style= " background-image: url( ';
echo $featured_image;
echo ')">';
echo '
';
echo '
';
echo '
';
}
} else { // home page
};