Stop feature images from displaying as headers
-
I can’t seem to stop the feature images from replacing the header image on single post pages.
I have created a child-theme and have followed the instructions in both of these threads and the feature image is still displaying as the header on the single post pages.
https://www.ads-software.com/support/topic/setting-featured-image-changes-the-post-header/https://www.ads-software.com/support/topic/making-the-header-stay-put-on-blog-posts/
Currently, the header.php file in my child-theme is saved with this code:
<?php // Let's show a header image if we aren't on the front page and a header has been set if ( ! pique_is_frontpage() AND get_header_image() ) : ?> <a class="pique-header" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> <?php // If the post uses a Featured Image, let's show that if ( is_singular() && has_post_thumbnail() ) : ?> <img id="pique-header-image" src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php bloginfo( 'name' ); ?>"> <?php endif; // End featured image check. ?> </a> <?php endif; // End header image check. ?>
The blog page here displays the correct header and the feature image as the background (which I want):
https://panopticnews.com/foundations/blog/The single post page here displays the feature image as the header which I don’t want:
https://panopticnews.com/foundations/need-a-google-account/Are you able to tell me what I’m doing wrong? Thank you. Tanya
- The topic ‘Stop feature images from displaying as headers’ is closed to new replies.