WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to remove the header image on all the pages except my "home"-page.

Any ideas?


share|improve this question

Edit the header.php file and modify the following lines (probably around line 78-82):


            // Check to see if the header image has been removed
            $header_image = get_header_image();
            if ( ! empty( $header_image ) ) :


            // Check to see if the header image has been removed
            $header_image = get_header_image();
            if ( ! empty( $header_image ) && is_front_page() ) :
share|improve this answer
Actually, I think you want to use is_front_page() rather than is_home(). The former returns true when the site front page is displayed, while the latter returns true when the blog posts index is being displayed. – Chip Bennett Oct 13 '11 at 18:31
@Chip Bennett Good point. Fixed. – Doug Oct 13 '11 at 18:33
Thank you very much! It works! – Highlander Oct 14 '11 at 18:36
in a child them, we can do this with template files, but can we do this in function.php file? this will be awesome. – Thanh-Cong Vo Jan 6 '12 at 5:39

This worked for me.


if ( $header_image) :


if ( $header_image && is_front_page()) :

share|improve this answer

Remove the header image code from your category, post, single, etc files (leaving it in the index.php file).

If that is not of help, please explain the structure of your theme as well as post some code for additional help.

share|improve this answer
The original question specified the Twenty Eleven theme. The header image code is in the header.php file, not in all those individual files (as is probably the case in 99.9% of all themes). – Doug Oct 13 '11 at 18:32
no worries bro but thanks for toasting my bread. – Devise Oct 13 '11 at 18:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.