WordPress.org

Make WordPress Core

Changeset 20474


Ignore:
Timestamp:
04/15/12 20:51:24 (6 years ago)
Author:
nacin
Message:

Flexible heights for Twenty Ten's custom headers. see #20448.

Location:
trunk/wp-content/themes/twentyten
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/functions.php

    r20473 r20474  
    106106        'width' => apply_filters( 'twentyten_header_image_width', 940 ), 
    107107        'height' => apply_filters( 'twentyten_header_image_height', 198 ), 
     108        // Support flexible heights. 
     109        'flex-height' => true, 
    108110        // Don't support text inside the header image. 
    109111        'header-text' => false, 
  • trunk/wp-content/themes/twentyten/header.php

    r20225 r20474  
    7474                        // Houston, we have a new header image! 
    7575                        echo get_the_post_thumbnail( $post->ID ); 
    76                     elseif ( get_header_image() ) : ?> 
    77                         <img src="<?php header_image(); ?>" width="<?php echo get_theme_support( 'custom-header', 'width' ); ?>" height="<?php echo get_theme_support( 'custom-header', 'height' ); ?>" alt="" /> 
     76                    elseif ( get_header_image() ) :  
     77                        if ( function_exists( 'get_custom_header' ) ) { 
     78                            $header_width  = get_custom_header()->width; 
     79                            $header_height = get_custom_header()->height; 
     80                        } else { 
     81                            $header_height = $header_width = ''; 
     82                        } 
     83                        ?> 
     84                        <img src="<?php header_image(); ?>" width="<?php echo $header_width; ?>" height="<?php echo $header_height; ?>" alt="" /> 
    7885                    <?php endif; ?> 
    7986            </div><!-- #branding --> 
Note: See TracChangeset for help on using the changeset viewer.