Multiple, Custom Footers for WordPress

September 3, 2007, updated September 3, 2007

I use two different footers for my WordPress template, the default one (footer.php) and a custom one (footer-alt.php). Here's how to create and use more than one type of footer with WordPress (depending on your individual theme of course):

1. Save a backup copy of the theme template folder to be edited onto your hard drive just in case something goes awry. It is found in the WordPress folder in wp-content -> themes -> (the name of your chosen theme).

2. Duplicate your theme's footer.php file and rename this new file something else. I chose footer-alt.php, which I will use for this example. Make sure that footer-alt.php is in the same folder/directory as footer.php.

3. Edit footer-alt.php to make whatever changes to it that you wish. I use a text editor for this.

4. Decide which pages should show this new footer:

  • Home page (main blog pages): home.php or index.php
  • Pages (such as an "About" page): page.php
  • Wordpress search results pages: search.php
  • Individual post pages: single.php
  • Category pages: category.php
  • Archives pages: archive.php or archives.php

5. Replace the code to include footer.php on your chosen pages with that for the new footer-alt.php:

Replace this code:

<?php get_footer(); ?>

with this code to instead include footer-alt.php:

<?php include (TEMPLATEPATH . '/footer-alt.php'); ?>

6. Save and upload your altered php files and the new footer-alt.php.

Category:  Computer