Advertisement
alchymyth

header image code twenty ten

Apr 20th, 2011
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2.                     // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  3.                     if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
  4.                             has_post_thumbnail( $post->ID ) &&
  5.                             ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
  6.                             $image[1] >= HEADER_IMAGE_WIDTH ) :
  7.                         // Houston, we have a new header image!
  8.                         echo get_the_post_thumbnail( $post->ID );
  9.                     elseif ( get_header_image() ) : ?>
  10.                         <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  11.                     <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement