WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a blog on wordpress.com in which I make use of the Twenty Ten theme. For each Post I can set a Featured image.

On Wordpress.com that image is then displayed in the header above the menu.

I'd like to gain the same for a Wordpress.org setup. How can I do this?

share|improve this question
isn't that already implemented in TwentyTen? I remember seeing the featured image in the header area.. – onetrickpony Mar 25 '11 at 23:50
I'm running a 3.0.5 site and it is not working that way. I think I need to debug further because I thought as well, that it should already work that way. – hakre Mar 26 '11 at 2:34
up vote 2 down vote accepted

Not sure I understand your question completely hakre but here is the code that shows the featured image for twenty-ten in header.php.The image sizing is defined in the functions.php file.

It also uses a function called http://codex.wordpress.org/Function_Reference/get_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() && 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="" />
                    <?php endif; ?>
share|improve this answer
Thanks for the hint Wyck, it's probably related that I downloaded too small images and expected to get them blown up: $image[1] >= HEADER_IMAGE_WIDTH. – hakre Mar 29 '11 at 15:39
Yes it is [15 chars] – hakre Mar 29 '11 at 18:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.