Title: get_footer
Published: April 25, 2014
Last modified: February 24, 2026

---

# get_footer( string|null $name = null, array $args = array() ): void|false

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#wp--skip-link--target)

Loads footer template.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#description)󠁿

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

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#parameters)󠁿

 `$name`string|nulloptional

The name of the specialized footer.

Default:`null`

`$args`arrayoptional

Additional arguments passed to the footer template.

Default:`array()`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#return)󠁿

 void|false Void on success, false if the template does not exist.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#source)󠁿

    ```php
    function get_footer( $name = null, $args = array() ) {
    	/**
    	 * Fires before the footer template file is loaded.
    	 *
    	 * @since 2.1.0
    	 * @since 2.8.0 The `$name` parameter was added.
    	 * @since 5.5.0 The `$args` parameter was added.
    	 *
    	 * @param string|null $name Name of the specific footer file to use. Null for the default footer.
    	 * @param array       $args Additional arguments passed to the footer template.
    	 */
    	do_action( 'get_footer', $name, $args );

    	$templates = array();
    	$name      = (string) $name;
    	if ( '' !== $name ) {
    		$templates[] = "footer-{$name}.php";
    	}

    	$templates[] = 'footer.php';

    	if ( ! locate_template( $templates, true, true, $args ) ) {
    		return false;
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/general-template.php#L71)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/general-template.php#L71-L95)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#hooks)󠁿

 [do_action( ‘get_footer’, string|null $name, array $args )](https://developer.wordpress.org/reference/hooks/get_footer/)

Fires before the footer template file is loaded.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#related)󠁿

| Uses | Description | 
| [locate_template()](https://developer.wordpress.org/reference/functions/locate_template/)`wp-includes/template.php` |

Retrieves the name of the highest priority template file that exists.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 5 content](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#comment-content-574)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/get_footer/#comment-574)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-574)
     Vote results for this note: 7[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-574)
 4.  **Multi footers**
      Different footer for different pages.
 5.      ```php
         <?php
         if ( is_home() ) :
         	get_footer( 'home' );
         elseif ( is_404() ) :
         	get_footer( '404' );
         else :
         	get_footer();
         endif;
         ?>
         ```
     
 6.  The file names for the home and 404 footers should be `footer-home.php` and `footer-
     404.php` respectively.
 7.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%3Freplytocom%3D574%23feedback-editor-574)
 8.   [Skip to note 6 content](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#comment-content-2864)
 9.    [Barrett Golding](https://profiles.wordpress.org/hearvox/)  [  8 years ago  ](https://developer.wordpress.org/reference/functions/get_footer/#comment-2864)
 10. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-2864)
     Vote results for this note: 3[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-2864)
 11. **Named footer template**
      Load an alternate footer file by using the `$name` 
     param: `<?php get_footer( 'special' ); ?>`
 12. The above code in a theme file will load the template file: `footer-special.php`.
     If not found, will default to loading: `footer.php`.
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%3Freplytocom%3D2864%23feedback-editor-2864)
 14.  [Skip to note 7 content](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#comment-content-5448)
 15.   [Muhammad Jawad Abbasi](https://profiles.wordpress.org/jawad1234/)  [  4 years ago  ](https://developer.wordpress.org/reference/functions/get_footer/#comment-5448)
 16. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-5448)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-5448)
 17. Create footer-new.php file in theme main directory and put that code
 18.     ```php
         <?php echo $args['name']; ?> <br> <?php echo $args['location']; ?>
         ```
     
 19.     ```php
         // that code put in page.php, single.php etc
         // I have put that code in index.php file
         <?php
         get_footer('new',array('name'=>'Muhammad Jawad Abbasi','location'=>'Pakistan'));
         ?>
         ```
     
 20. **Output:**
      Muhammad Jawad Abbasi Pakistan
 21.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%3Freplytocom%3D5448%23feedback-editor-5448)
 22.  [Skip to note 8 content](https://developer.wordpress.org/reference/functions/get_footer/?output_format=md#comment-content-573)
 23.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/get_footer/#comment-573)
 24. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-573)
     Vote results for this note: -1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%23comment-573)
 25. **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`).
 26.     ```php
         <?php get_header(); ?>
         <h2>Error 404 - Not Found</h2>
         <?php get_sidebar(); ?>
         <?php get_footer(); ?>
         ```
     
 27.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F%3Freplytocom%3D573%23feedback-editor-573)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_footer%2F)
before being able to contribute a note or feedback.