Advertisement
Guest User

Untitled

a guest
Jan 19th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <?php
  2. if( !is_page('photos' ) : // check for photos page
  3. // Check to see if the header image has been removed
  4. $header_image = get_header_image();
  5. if ( ! empty( $header_image ) ) :
  6. ?>
  7. <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
  8. <?php
  9. // The header image
  10. // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  11. if ( is_singular() &&
  12. has_post_thumbnail( $post->ID ) &&
  13. ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) &&
  14. $image[1] >= HEADER_IMAGE_WIDTH ) :
  15. // Houston, we have a new header image!
  16. echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
  17. else : ?>
  18. <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  19. <?php endif; // end check for featured image or standard header ?>
  20. </a>
  21. <?php endif; // end check for removed header image ?>
  22. <?php endif; // end check for photos page ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement