Advertisement
alchymyth

header image section TwEleven 1.4

Jul 20th, 2012
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 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 ?>
  21.             <?php
  22.                 // Has the text been hidden?
  23.                 if ( 'blank' == get_header_textcolor() ) :
  24.             ?>
  25.                 <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
  26.                 <?php get_search_form(); ?>
  27.                 </div>
  28.             <?php
  29.                 else :
  30.             ?>
  31.                 <?php get_search_form(); ?>
  32.             <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement