Support » Theme: Twenty Ten » Bug:Twenty Ten Feature image sometimes replaces header on post page?

  • If I add a feature image to posts in my blog, the header image on the actual blog post page gets replaced with the feature image.

    is this a bug? I can’t find any rhyme or reason to it. It only happens on certain posts

    using latest twenty ten theme. I haven’t modified it at all

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p


    -try deactivating ALL plugins temporarily to narrow down and possibly fix the problem. If the problem goes away, activate them individually (one-by-one) to find the problematic plugin.

    Weird I tried that and still doesn’t work. As far as I can tell from the template code it’s checking to see if I have a an attachment thumbnail? But why wouldn’t it show on every page instead of seemingly at random. I can’t see anywhere in my posts where I told it to attach thumbnail to particular post. All I did was ‘set as feature image’

    // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    if ( is_singular() &&
    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!
    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    else : ?>
    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    <?php endif; ?>
    </div><!-- #branding -->

    Moderator t-p


    are you using a child theme of twentyten? If you are, try:

    -switching to the default theme (that came with the WP) for a moment by renaming your current theme’s folder in wp-content/themes. The idea is to force WordPress to fall back to the default theme to rule out any theme-specific issue.

    Doh! I just realized by reading code more closely it will swap out header image only if the feature image is at least as wide as your original header!!!

    Problem solved. Thanks 😀

    Moderator t-p


    Glad you got it resolved.:-)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Bug:Twenty Ten Feature image sometimes replaces header on post page?’ is closed to new replies.