Advertisement
alchymyth

header baner on static front page only / twenty ten

Nov 22nd, 2011
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.44 KB | None | 0 0
  1. edit header.php, find this section:
  2.  
  3. <?php
  4.                     // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  5.                     if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
  6.                             has_post_thumbnail( $post->ID ) &&
  7.                             ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
  8.                             $image[1] >= HEADER_IMAGE_WIDTH ) :
  9.                         // Houston, we have a new header image!
  10.                         echo get_the_post_thumbnail( $post->ID );
  11.                     elseif ( get_header_image() ) : ?>
  12.                         <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  13.                     <?php endif; ?>
  14.  
  15. change to:
  16.  
  17. <?php
  18.                     // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  19.                     if ( is_front_page() && is_singular() && current_theme_supports( 'post-thumbnails' ) &&
  20.                             has_post_thumbnail( $post->ID ) &&
  21.                             ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
  22.                             $image[1] >= HEADER_IMAGE_WIDTH ) :
  23.                         // Houston, we have a new header image!
  24.                         echo get_the_post_thumbnail( $post->ID );
  25.                     elseif ( is_front_page() && get_header_image() ) : ?>
  26.                         <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  27.                     <?php endif; ?>
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement