A header and footer are important parts of a website layout. The header usually contains the logo and navigation menu, while the footer contains copyright information, contact details and useful links.
A header is the top section of a website. It commonly appears across multiple pages and helps visitors identify the website and navigate to important sections.
A footer is the bottom section of a website. It provides additional information and links that visitors may need.
Computer education and programming tutorials.
Home | Courses | Tutorials
Email, phone and address information.
© 2026 Soopro Pathshala. All rights reserved.
| Feature | Header | Footer |
|---|---|---|
| Position | Usually at the top | Usually at the bottom |
| Main Purpose | Branding and navigation | Additional information and links |
| Typical Content | Logo, menu and buttons | Copyright, contact and policies |
| Appearance | Often visible immediately | Usually appears after page content |
Block themes let you edit website layouts through the WordPress Site Editor. The header is commonly managed as a template part.
In a block theme, the footer can usually be edited in the Site Editor using a Footer template part.
Classic themes may provide header and footer settings in the Customizer, theme options or widget areas. Some classic themes require template-file editing for advanced changes.
To check available options, open the Customizer or theme settings. The menu names and available controls vary from theme to theme.
Developers working with classic WordPress themes may use PHP template files to build a reusable header and footer.
| File | Purpose |
|---|---|
header.php |
Contains the shared header markup. |
footer.php |
Contains the shared footer markup. |
functions.php |
Registers theme features and functions. |
style.css |
Contains the theme stylesheet and theme metadata. |
index.php |
Provides a main template fallback in classic themes. |
templates directory and block template parts in
parts. Avoid editing a parent theme directly because
updates may overwrite your changes.
The following is a simplified example for a classic WordPress theme. It demonstrates how a theme can display its title and registered navigation menu.
Example code for a classic theme's template file:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<header class="site-header">
<div class="site-branding">
<?php if (has_custom_logo()) {
the_custom_logo();
} else { ?>
<a href="<?php echo esc_url(home_url('/')); ?>">
<?php bloginfo('name'); ?>
</a>
<?php } ?>
</div>
<nav class="main-navigation">
<?php
wp_nav_menu(array(
'theme_location' => 'primary',
'fallback_cb' => false
));
?>
</nav>
</header>
Explanation: This example uses WordPress
template functions to display the site branding and a
registered menu. The theme must register the
primary menu location for the menu to appear.
The footer template commonly contains the footer content and required WordPress footer hooks.
<footer class="site-footer">
<p>
© <?php echo esc_html(date('Y')); ?>
<?php bloginfo('name'); ?>.
All rights reserved.
</p>
</footer>
<?php wp_footer(); ?>
</body>
</html>
Explanation: The code displays the current
year and website name. The wp_footer() hook
allows WordPress and plugins to output scripts and other
footer content.
In a classic theme, CSS can control the appearance of the header and footer. Add the styles to your theme stylesheet or an appropriate custom CSS area.
.site-header {
background-color: #0f172a;
color: #ffffff;
padding: 20px;
}
.site-header a {
color: #ffffff;
text-decoration: none;
}
.site-footer {
background-color: #212529;
color: #ffffff;
padding: 25px;
text-align: center;
}
.site-footer a {
color: #f8f9fa;
}
@media (max-width: 768px) {
.site-header,
.site-footer {
padding: 15px;
}
}
Note: These styles apply to the example class names shown above. Your theme's HTML and CSS classes may be different.
Use your WordPress website to complete these tasks:
Challenge: Create a header with a logo, navigation menu and admission button, plus a three-column footer for a computer training institute.
header.php and footer.php are common classic theme files.wp_head() and wp_footer() hooks support WordPress and plugin functionality.Choose the correct answer for each question.