Viewing 5 replies - 1 through 5 (of 5 total)
  • Because that’s how the Twenty Ten theme works. It uses the first image in a post as the header image in a single post page.

    Thread Starter Ncastro340

    (@ncastro340)

    how can I prevent this from happening?

    Create a child theme, copy header.php from the parent into the child and then edit the header,php file in the child theme to remove the post image on single post pages.

    Thread Starter Ncastro340

    (@ncastro340)

    Thanks, once I removed this code in header.php the images were no longer there.

    <?php
    					// 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; ?>

    Warning: If you amended the Twenty Ten theme itself, your customisations will be over-written the next time you upgrade WordPress or the theme. For this reason, it is recommended that you consider creating a child theme for your customisations.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Post Images duplicating on top of my header….?’ is closed to new replies.