WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get header image

Description

Retrieve header image for custom header.

Usage

<?php get_header_image(); ?>

Parameters

None.

Return Values

(string) 
Returns header image URL.

An empty string will be returned 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

<img src="<?php echo( get_header_image() ); ?>" alt="<?php echo( get_bloginfo( 'title' ) ); ?>" />

Notes

  • Uses: HEADER_IMAGE

Change Log

Since: 2.1.0

Source File

get_header_image() is located in wp-includes/theme.php.

Related

See also index of Function Reference and index of Template Tags.