Languages:
English •
Italiano •
(Add your language)
Description
Check whether a header image for the current theme is set or not.
Usage
<?php has_header_image() ?>
Parameters
None.
Return Values
- (bool)
- Returns true if a header image has been set, otherwise false if:
- The current theme does NOT support header images. (Learn how to enable it in Custom Headers page).
- The current theme DOES support header images. However, the user has selected the "Remove Header Image" option from the Appearance -> Header screen.
Examples
<?php if ( has_header_image() ) { ?>
<img src="<?php echo( get_header_image() ); ?>" alt="<?php echo( get_bloginfo( 'title' ) ); ?>" />
<?php } ?>
Change Log
Since: 4.2.0
Source File
has_header_image() is located in wp-includes/theme.php
.
Related