WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Different headers on every different page on Twenty Ten (5 posts)

  1. Droidex
    Member
    Posted 4 years ago #

    Trying this theme: in the official web http://2010dev.wordpress.com/ there is different headers every page, but i can not see how to do it on my installation.

    Thanks and keep the good work, it is a great theme!

  2. MichaelH
    Member
    Posted 4 years ago #

    I believe that might be made possible if there is a post thumbnail on that page is uses it. Here's the pertinent code from wp-content/themes/twentyten/header.php:

    <?php
    					// Retrieve the dimensions of the current post thumbnail -- no teensy header images for us!
    					$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail');
    					list($src, $width, $height) = $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 ) && $width >= 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; ?>
  3. Droidex
    Member
    Posted 4 years ago #

    The problem is that there is no place to set the post-thumbnail, got the featured image, but not the post-thumbnail setting.

    Thanks for reply

  4. MichaelH
    Member
    Posted 4 years ago #

    On a clean 3.0-beta install, was able to upload an image to the About page, clicked on the use as featured image and it used that image in the header when displaying that page.

  5. Droidex
    Member
    Posted 4 years ago #

    That worked!

    Thanks!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.