Viewing 3 replies - 1 through 3 (of 3 total)
  • this is so be design – if the ‘featured’ image of a post is larger than a set width, it will get taken as the header image for that single post (similar for static pages).

    try and use a smaller image as featured image.

    alternatively, you will need to edit header.php in a child theme, to remove this automatic header image replacement code.

    Thread Starter stillesbunt

    (@stillesbunt)

    Thanks for the fast answer! So, concerning the featured image – I never did anything different with my latest post, than before. So this is strange.

    Concerning the changes to the header.php – I found this snippet:

    <?php
    // Check if this is a post or page, if it has a thumbnail, and if it’s a big one
    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!
    echo get_the_post_thumbnail( $post->ID );
    elseif ( get_header_image() ) : ?>
    <img src=”<?php header_image(); ?>” width=”<?php echo HEADER_IMAGE_WIDTH; ?>” height=”<?php echo HEADER_IMAGE_HEIGHT; ?>” alt=”” />

    You think the changes should be made here?

    Thanks again for your help!
    Lilly

    that is the right section to edit (in the child theme);

    for example, change it to:

    <?php if ( get_header_image() ) : ?>
    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />

    caveat:
    not tested;
    it is recommended to make a backup copy before editing – https://codex.www.ads-software.com/WordPress_Backups

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Header image in blog post gone twenty ten’ is closed to new replies.