header.php
Fallback header template for themes that do not provide their own.
Source: wp-includes/theme-compat/header.php
Deprecated: 3.0.0
Subpackage: Theme_Compat
Purpose
Loaded by get_header() when the active theme has no header.php. Outputs a complete HTML document opening with Kubrick-era styling.
Behavior
Calls
_deprecated_file()— triggers a deprecation notice telling theme authors to include their ownheader.php.Outputs
<!DOCTYPE html>and<html>tag withlanguage_attributes().<head>section includes:- XFN profile link (
https://gmpg.org/xfn/11) - Content-Type meta tag via
bloginfo( 'html_type' )andbloginfo( 'charset' ) - Document title via
wp_get_document_title() - Stylesheet link via
bloginfo( 'stylesheet_url' ) - Pingback link via
bloginfo( 'pingback_url' )
- XFN profile link (
Kubrick background image logic:
- Checks if
get_stylesheet_directory() . '/images/kubrickbgwide.jpg'exists viafile_exists()
- Checks if
Enqueues
comment-replyscript ifis_singular()returns true.Calls
wp_head().Opens
<body>tag withbody_class().Outputs header markup:
<div id="page"><div id="header" role="banner">containing<div id="headerimg"><h1>linking tohome_url()withbloginfo( 'name' )<div class="description">withbloginfo( 'description' )- Closing
</div>s for headerimg and header <hr />
Functions Called
| Function | Purpose |
|---|---|
_deprecated_file() | Deprecation notice |
__() | Translation |
sprintf() | String formatting |
basename() | Get filename |
language_attributes() | HTML lang attribute |
bloginfo() | Site info (html_type, charset, stylesheet_url, pingback_url, stylesheet_directory, text_direction, name, description, url) |
wp_get_document_title() | Page title |
get_stylesheet_directory() | Theme directory path |
file_exists() | Check Kubrick background image |
is_single() | Check if single post |
is_singular() | Check if singular content |
wp_enqueue_script() | Enqueue comment-reply JS |
wp_head() | Head hook output |
body_class() | Body CSS classes |
home_url() | Site home URL |
Variables Referenced
| Variable | Purpose |
|---|---|
$withcomments | Global; if empty and not single, uses narrow background |