Use the_header_image_tag() function.

This commit is contained in:
Sami Keijonen 2016-11-27 12:57:24 +02:00
parent 31a9e90437
commit 2370c59676
1 changed files with 1 additions and 3 deletions

View File

@ -4,9 +4,7 @@
* *
* You can add an optional custom header image to header.php like so ... * You can add an optional custom header image to header.php like so ...
* *
<?php if ( get_header_image() ) : ?> <?php the_header_image_tag(); ?>
<img src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="">
<?php endif; // End header image check. ?>
* *
* @link https://developer.wordpress.org/themes/functionality/custom-headers/ * @link https://developer.wordpress.org/themes/functionality/custom-headers/
* *