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

git-svn-id: https://develop.svn.wordpress.org/trunk@20474 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-04-15 20:51:24 +00:00
parent 91bb85bcff
commit 95c85ceeee
2 changed files with 11 additions and 2 deletions

View File

@ -105,6 +105,8 @@ function twentyten_setup() {
// The height and width of our custom header.
'width' => apply_filters( 'twentyten_header_image_width', 940 ),
'height' => apply_filters( 'twentyten_header_image_height', 198 ),
// Support flexible heights.
'flex-height' => true,
// Don't support text inside the header image.
'header-text' => false,
// Callback for styling the header preview in the admin.

View File

@ -73,8 +73,15 @@
$image[1] >= get_theme_support( 'custom-header', 'width' ) ) :
// Houston, we have a new header image!
echo get_the_post_thumbnail( $post->ID );
elseif ( get_header_image() ) : ?>
<img src="<?php header_image(); ?>" width="<?php echo get_theme_support( 'custom-header', 'width' ); ?>" height="<?php echo get_theme_support( 'custom-header', 'height' ); ?>" alt="" />
elseif ( get_header_image() ) :
if ( function_exists( 'get_custom_header' ) ) {
$header_width = get_custom_header()->width;
$header_height = get_custom_header()->height;
} else {
$header_height = $header_width = '';
}
?>
<img src="<?php header_image(); ?>" width="<?php echo $header_width; ?>" height="<?php echo $header_height; ?>" alt="" />
<?php endif; ?>
</div><!-- #branding -->