has_header_image()
Check whether a header image is set or not.
Used By: has_custom_header()
No Hooks.
Return
true|false
. Whether a header image is set or not.
Usage
has_header_image();
Examples
#1 Let's check if the theme has a header picture
Display a picture if there is one:
if( has_header_image() ) echo '<img src="'. get_header_image() .'" alt="'. get_bloginfo('title') .'">'; }
See also:
Notes
- See: get_header_image()
Changelog
Since 4.2.0 | Introduced. |
has_header_image() has header image code WP 6.7.2
function has_header_image() { return (bool) get_header_image(); }