Support » Themes and Templates » Twenty Ten – Featured images overriding Header image?

  • atracksler

    (@atracksler)


    In looking through the functions.php, it seems like the page and post featured images should override the header images…

    // We'll be using post thumbnails for custom header images on posts and pages.
    	// We want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit).
    	set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );

    Wghat do I need to do to make this happen? I have a featured image uploaded to my post and the standard header image is still showing up…

    any ideas?

Viewing 12 replies - 1 through 12 (of 12 total)
  • elfin

    (@elfin)

    The image need to be of the correct size, or greater, so if it is smaller than 940px wide it won’t replace the default header image.

    atracksler

    (@atracksler)

    okay, so my image is larger than the 940 px..

    I have the image in the post and as the “featured image” for the post and still isnt showing up… any other ideas?

    elfin

    (@elfin)

    check the header.php of twentyten

    around line 58 there is a comment like this:
    // Check if this is a post or page, if it has a thumbnail, and if it's a big one

    is that still there in your copy?

    atracksler

    (@atracksler)

    yes

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

    (@elfin)

    Then it should work. Are you 100% sure you have a featured image set on the relevant page, and it is of the correct dimensions?

    atracksler

    (@atracksler)

    in the backend it is showing in the featured image section and it is bigger than the space allotted….

    is the featured image different than the post thumbnail?

    elfin

    (@elfin)

    Hmmm I just tested it and it is working for me. Strange.

    atracksler

    (@atracksler)

    i did change the thumbnail defaults in functions.php to:

    // The height and width of your custom header. You can hook into the theme's own filters to change these values.
    	// Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
    	define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 879 ) );
    	define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 250 ) );

    could that be causing it?

    elfin

    (@elfin)

    No that should work ok. I just tested my copy and it works ok.

    perhaps you should download a fresh copy of twentyten(it’s in the theme directory) and try it without any alterations?

    atracksler

    (@atracksler)

    well, I changed to twentyten (my custom theme is based on 2010… and still no go.

    http://clc.citlchurches.info/2010/06/22/hello-world/

    the image of the dogs tongue is the featured image, as well as inserted into the post…I feel like I’m doing something wrong…..

    elfin

    (@elfin)

    Hadn’t realised you were using multisite – however I’ve just checked and can say that on my test server it still works.

    Have you got any plugins installed that affect thumbnail images?

    atracksler

    (@atracksler)

    i turned off all plugins that had anything to do with images, and still no….

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Twenty Ten – Featured images overriding Header image?’ is closed to new replies.