WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Ten
[resolved] Bug:Twenty Ten Feature image sometimes replaces header on post page? (6 posts)

  1. X1-Bot
    Member
    Posted 3 years ago #

    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

  2. Tara
    Member
    Posted 3 years ago #

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

  3. X1-Bot
    Member
    Posted 3 years ago #

    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 -->

  4. Tara
    Member
    Posted 3 years ago #

    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.

  5. X1-Bot
    Member
    Posted 3 years ago #

    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 :D

  6. Tara
    Member
    Posted 3 years ago #

    Glad you got it resolved.:-)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags