Title: has_custom_header
Published: December 7, 2016
Last modified: May 20, 2026

---

# has_custom_header(): bool

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#wp--skip-link--target)

Checks whether a custom header is set or not.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#return)󠁿

 bool True if a custom header is set. False if not.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#source)󠁿

    ```php
    function has_custom_header() {
    	if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) {
    		return true;
    	}

    	return false;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/theme.php#L1751)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/theme.php#L1751-L1757)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#related)󠁿

| Uses | Description | 
| [has_header_video()](https://developer.wordpress.org/reference/functions/has_header_video/)`wp-includes/theme.php` |

Checks whether a header video is set or not.

  | 
| [is_header_video_active()](https://developer.wordpress.org/reference/functions/is_header_video_active/)`wp-includes/theme.php` |

Checks whether the custom header video is eligible to show on the current page.

  | 
| [has_header_image()](https://developer.wordpress.org/reference/functions/has_header_image/)`wp-includes/theme.php` |

Checks whether a header image is set or not.

  |

| Used by | Description | 
| [get_custom_header_markup()](https://developer.wordpress.org/reference/functions/get_custom_header_markup/)`wp-includes/theme.php` |

Retrieves the markup for a custom header.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/has_custom_header/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_header%2F)
before being able to contribute a note or feedback.