How to remove header for single blog post?

Hi,

I’m using twenty twelve theme and do not want the header image to appear in my single blog post. May I know how can I do that?

My website is at nature-health.com and this is one of my blog post.

Any help is appreciated.

You have to remove header code from single.php file which have code for single post. go in editor and open single.php and remove header code. It is very simple.

Hi, thank you. I follow what you say and remove the get_header(); but the website breaks without all the formatting… is this the code to remove in single.php?

You may need to go to the header file itself and set a condition for when that part of the header does or does not appear.

An easier, but not as good, option is simply to add this to your CSS:

.single .header-image {display: none;}

You save the day, Ralph! Thank you so much!

Hi there,

As Ralph says, his solution works, but is not optimal, as the image is still downloaded (which is not so good for mobile users, for example).

Alternatively, you could edit the file “header.php” in the Twenty Twelve theme and change this:

<?php $header_image = get_header_image();
  if ( ! empty( $header_image ) ) : ?>
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
<?php endif; ?>

to this:

<?php $header_image = get_header_image();
  if ( ! empty( $header_image ) && ! is_single()) : ?>
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
<?php endif; ?>

which will have the same effect.

BTW: I didn’t test this code, so if you try it out and it doesn’t work, just let me know.

To remove the header you can also do this via template file coding.
There you can remove the code of header part only or you can change it with your customized header file like image or simple text lines.