get_header_image()
Retrieve header image for custom header.
Uses: get_theme_mod()
Used By: header_image()
Hooks from the function
Return
String|false
.
Usage
get_header_image();
Examples
#1 Display an img image tag for the header
<img src="<?php echo get_header_image(); ?>" alt="<?php bloginfo('title'); ?>">
Before using this, check out get_header_image_tag() first.
It will return an tag including the srcset
attributes for responsive images.
#2 Display IMG tag using the_custom_header_markup()
the_custom_header_markup();
Can be use in place of:
<img alt="" src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" >
Changelog
Since 2.1.0 | Introduced. |