Languages: English • Español • 日本語 Македонски • Русский • (Add your language)
Includes the header.php template file from your current theme's directory. If a name is specified then a specialised header header-{name}.php will be included.
If the theme contains no header.php file then the header from the default theme wp-includes/theme-compat/header.php
will be included.
<?php get_header( $name ); ?>
The following code is a simple example of a template for an "HTTP 404: Not Found" error (which you could include in your Theme as 404.php).
<?php get_header(); ?> <h2>Error 404 - Not Found</h2> <?php get_sidebar(); ?> <?php get_footer(); ?>
Different header for different pages.
<?php if ( is_home() ) : get_header( 'home' ); elseif ( is_404() ) : get_header( '404' ); else : get_header(); endif; ?>
The file names for the home and 404 headers should be header-home.php and header-404.php respectively.
get_header() is located in wp-includes/general-template.php
.