Advertisement
alchymyth

twenty ten header without automatic change

Apr 21st, 2011
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. BEARBEITE DIESEN TEIL IN HEADER.PHP
  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. OHNE THUMBNAIL CHANGE: ENTFERNE ALLES ANDERE UND LASS NUR DAS HIER:
  16.  
  17. <?php
  18. if ( get_header_image() ) : ?>
  19. <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  20. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement