get_header_image()
Retrieve header image for custom header.
Description Description
Return Return
(string|false)
Source Source
File: wp-includes/theme.php
function get_header_image() {
$url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
if ( 'remove-header' == $url ) {
return false;
}
if ( is_random_header_image() ) {
$url = get_random_header_image();
}
return esc_url_raw( set_url_scheme( $url ) );
}
Expand full source code Collapse full source code View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Before using this, check out get_header_image_tag() first. That’s a new function in 4.4 that’ll return an tag including the srcset attributes for responsive images.
http://wpsocket.com/wpref/function/get_header_image_tag/
Related:
header_image
has_header_image
can be use in place of
Example