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.
| SitePoint Sponsor |




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.






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:
Code:.single .header-image {display: none;}
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.





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:
to this:PHP Code:<?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; ?>
which will have the same effect.PHP Code:<?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; ?>
BTW: I didn't test this code, so if you try it out and it doesn't work, just let me know.
How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
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.
Bookmarks