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'm using the Skeleton theme and the header image is on all pages. I only want it on the home page. Anyone got a solution?

share|improve this question
Please add code to your question, so that we can help answer it. – Chip Bennett Sep 3 '12 at 4:26
up vote 1 down vote accepted

The following one-liner removes regular header images:

! is_admin() && is_front_page() && add_filter( 'theme_mod_header_image', '__return_false' );

Usually, header images are saved and retrieved per Theme Modification API, which offers the same filter scheme "theme_mod_$name" for all theme data.


I see now, the theme is using the post thumbnail as header images on single views:

// Check if this is a post or page, if it has a thumbnail, and if it exceeds defined HEADER_IMAGE_WIDTH
if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) 
&& ( /* $src, $width, $height */
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ))
$image[1] >= HEADER_IMAGE_WIDTH ) :
// Houston, we have a new header image!
$image_attr = array(
            'class' => "scale-with-grid",
            'alt'   => trim(strip_tags( $attachment->post_excerpt )),
            'title' => trim(strip_tags( $attachment->post_title ))
echo '<div id="header_image" class="row sixteen columns">'.get_the_post_thumbnail( $post->ID, array("HEADER_IMAGE_WIDTH","HEADER_IMAGE_HEIGHT"), $image_attr ).'</div>';
elseif ( get_header_image() ) : ?>
    <div id="header_image" class="row sixteen columns"><img class="scale-with-grid round" src="<?php header_image(); ?>" alt="" /></div>
<?php endif; ?> 

You have to remove that code in your child theme and replace it with:

if ( is_front_page() && get_header_image() )
<div id="header_image" class="row sixteen columns">
    <img class="scale-with-grid round" src="<?php header_image(); ?>" alt="" />
share|improve this answer
Here is the template I downloaded github.com/simplethemes/skeleton_wp I am using the child theme and I am pretty new to wordpress. – Nick Ennis Sep 3 '12 at 19:53
Did my solution work for you? – toscho Sep 3 '12 at 20:04
// Houston, we have a solution. Thanks allot – Nick Ennis Sep 3 '12 at 20:52

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.