get_footer

Load footer template.

Description

get_footer( (null) $name = null ); 

Includes the footer template for a theme or if a name is specified then a specialised footer will be included.

For the parameter, if the file is called footer-special.php then specify "special".

Parameters (1)

0. $name — Optional. (null) => null
The name of the specialised footer.

Usage

  1. if ( !function_exists( 'get_footer' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4. // The name of the specialised footer. 
  5. $name = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_footer($name); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/general-template.php  
  1. function get_footer( $name = null ) { 
  2. /** 
  3. * Fires before the footer template file is loaded. 
  4. * The hook allows a specific footer template file to be used in place of the 
  5. * default footer template file. If your file is called footer-new.php,  
  6. * you would specify the filename in the hook as get_footer( 'new' ). 
  7. * @since 2.1.0 
  8. * @since 2.8.0 $name parameter added. 
  9. * @param string|null $name Name of the specific footer file to use. null for the default footer. 
  10. */ 
  11. do_action( 'get_footer', $name ); 
  12.  
  13. $templates = array(); 
  14. $name = (string) $name; 
  15. if ( '' !== $name ) { 
  16. $templates[] = "footer-{$name}.php"; 
  17.  
  18. $templates[] = 'footer.php'; 
  19.  
  20. locate_template( $templates, true );