_s: Simplify header image example markup.

`get_header_image()` will return the boolean false or an empty string if
there is no header image. Both will be evaluated as false by the if
statement.

Related: http://core.trac.wordpress.org/ticket/25156
This commit is contained in:
obenland 2013-09-23 14:39:15 -07:00
parent 1ba6c9e1fe
commit f572468099
1 changed files with 5 additions and 6 deletions

View File

@ -5,12 +5,11 @@
*
* You can add an optional custom header image to header.php like so ...
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
</a>
<?php } // if ( ! empty( $header_image ) ) ?>
<?php if ( get_header_image() ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
</a>
<?php endif; // End header image check. ?>
*
* @package _s