How to Create Different Sidebar and Footer Templates

By Lisa Sabin-Wilson

WordPress offers Sidebar and Footer templates. The Sidebar template in WordPress has the filename sidebar.php. The sidebar is usually found on the left or right side of the main content area of your WordPress theme. (The sidebar appears to the right of the main content area.) The sidebar is a good place to put useful information about your site, such as a site summary, advertisements, or testimonials.

Many themes use widget areas in the Sidebar template. This allows you to display content easily on your WordPress pages and posts. The following statement is the built-in WordPress function to call the Sidebar template:

<?php get_sidebar(); ?>

This code calls the Sidebar template and all the information it contains into your site.

The Footer template in WordPress has the filename footer.php. The footer is generally at the bottom of the page and contains brief reference information about the site. This usually includes copyright information, template design credits, and a mention of WordPress. Similar to the Header and Sidebar templates, the Footer template gets called into the Main Index template through this bit of code:

<?php get_footer(); ?>

This code calls the Footer template and all the information it contains into your site.

The default Twenty Thirteen theme shows a statement that says Proudly powered by WordPress. You can use the footer to include all sorts of information about your site, however; you don’t have to restrict it to small bits of information.

There is one line of code that should exist in every Footer template for any WordPress theme: <?php wp_footer(); ?>. This tag serves as a hook in WordPress that plugin developers use to insert necessary code and functions. Without this tag, the majority of plugins for WordPress will not function correctly, so be sure your Footer template includes the tag <?php wp_footer(); ?> before the closing </html> HTML markup.