WordPress.org

Forums

Featured image on posts page (4 posts)

  1. Amit Kvint
    Member
    Posted 2 years ago #

    Hi there,

    I have made one of my pages to be the main posts page while another is the front/home page

    Now when I attach a featured image to the main posts page it won't show there - the main header image is what comes up while the featured image for that page is ignored..on all the rest of the main pages & posts the featured image is replacing the header image (when set), can someone please tell me where & how can this be changed ? controlled?

    Thanks
    Amit

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    what is the current code for the header image (in header.php ?) ?

    http://codex.wordpress.org/Forum_Welcome#Posting_Code

  3. Amit Kvint
    Member
    Posted 2 years ago #

    <?php
    // The header 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 ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) &&
    $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; // end check for featured image or standard header ?>

    <?php endif; // end check for removed header image ?>

  4. alchymyth
    Forum Moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic