header_image()WP 2.1.0

Displays header image URL.

1 time — 0.005023 sec (very slow) | 50000 times — 3.03 sec (fast)

No Hooks.

Return

null. Nothing.

Usage

header_image();

Examples

0

#1 Display an img image tag for the header

<img src="<?php header_image(); ?>" alt="<?php bloginfo('title'); ?>">

Changelog

Since 2.1.0 Introduced.

header_image() code WP 6.1.1

function header_image() {
	$image = get_header_image();

	if ( $image ) {
		echo esc_url( $image );
	}
}