forked from mirror/_s
_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:
parent
1ba6c9e1fe
commit
f572468099
|
@ -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
|
||||
|
|
Reference in New Issue