get_footer() WP 1.5.0
Includes the footer.php template file from your current theme's directory. If a $name is specified then footer-{name}.php file will be included.
If the theme contains no footer.php file then the footer from the default theme wp-includes/theme-compat/footer.php
will be included.
Works based on: locate_template()
Hooks from the function
Return
null/false. Void on success, false if the template does not exist.
Usage
get_footer( $name, $args );
- $name(string)
- The name of the specialised footer.
Default: null - $args(array)
- Additional arguments passed to the footer template.
Default: empty array
Examples
#1 Simple 404 page
<?php get_header(); ?> <h2>Error 404 - Not Found</h2> <?php get_sidebar(); ?> <?php get_footer(); ?>
#2 Multiple Footers
<?php if ( is_home() ) : get_footer('home'); elseif ( is_404() ) : get_footer('404'); else : get_footer(); endif; ?>
The file names for the home and 404 footers should be footer-home.php
and footer-404.php
respectively.
Changelog
Since 1.5.0 | Introduced. |
Since 5.5.0 | A return value was added. |
Since 5.5.0 | The $args parameter was added. |
Code of get_footer() get footer WP 5.6
Related Functions
From category: Theme files connection
- comments_template()
- get_header()
- get_parent_theme_file_path()
- get_parent_theme_file_uri()
- get_search_form()
- get_sidebar()
More from Template Tags: Main Functions
- bloginfo()
- calendar_week_mod()
- get_bloginfo()
- get_calendar()
- get_current_blog_id()
- is_404()
- is_active_sidebar()
- is_admin()
- is_archive()
- is_attachment()
- is_author()
- is_category()
- is_comment_feed()
- is_date()
- is_day()
- is_dynamic_sidebar()
- is_embed()