Advertisement
alchymyth

header image fix twenty eleven 1.4

Jun 20th, 2012
1,074
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1.             <?php
  2.                 // Check to see if the header image has been removed
  3.                 $header_image = get_header_image();
  4.                 if ( $header_image ) :
  5.                    
  6.                         // We need to figure out what the minimum width should be for our featured image.
  7.                         // This result would be the suggested width if the theme were to implement flexible widths.
  8.                         $header_image_width = get_theme_support( 'custom-header', 'width' ); ?>
  9.  
  10.             <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
  11.                 <?php
  12.                     // The header image
  13.                    
  14.                             $header_image_width  = get_custom_header()->width;
  15.                             $header_image_height = get_custom_header()->height;                    
  16.                         ?>
  17.                     <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
  18.                
  19.             </a>
  20.             <?php endif; // end check for removed header image ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement