Codex

Function Reference/get footer

Contents

Description

Includes the footer.php template file from your current theme's directory. if a name is specified then a specialised footer footer-special.php will be included. If the theme contains no footer.php file then the footer from the default theme wp-content/themes/default/footer.php will be included.

Usage

<?php get_footer$name ); ?>

Parameters

$name
(string) (optional) Calls for footer-name.php.
Default: None

Examples

Simple 404 page

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(); ?>

Mullti footers

Different footer for different pages.

<?php
if ( is_home() ) :
  get_footer('home');
elseif ( is_404() ) :
  get_footer('404');
else :
  get_footer();
endif;
?>

Notes

Change Log

Since: 1.5.0

Source File

get_footer() is located in wp-includes/general-template.php.

Related

get_header, get_sidebar, get_search_form, comments_template, get_footer

See also index of Function Reference and index of Template Tags.