Tutorial: Widgetized “Fat” Footer

by Mike Nichols · 80 comments

There have been numerous threads in the DIYthemes Forums about making a widgetized “fat” footer. Most methods are fairly complicated, and the threads are often confusing.

Here is a solution that is simple to set up, needs no configuration and can be used right out of the box! It has been tested in both Thesis 1.5x and 1.6x.

This tutorial will show you how to put a 3- or 4- column widgetized footer on your site. The 3-column footer illustrated in Figure 1 is from the Thesis Theme Tools demo site:

Figure 1: 3-column widgetized "fat" footer

Figure 2 shows the 4-column footer at the bottom of the Thesis Theme Tools page:

Figure 2: 4-column widgetized "fat" footer

The widgetized footer in this article can contain any kind of widget, video, image, or other information that can be put in the sidebars — they are widgets just like any other widgets. The footer widget items appear in the WordPress widgets panel right along with the sidebars, so they are easy to set up.

There are two groups of code for the widgetized footer. One is put into your custom_functions.php file, and the other into your custom.css file. It does not matter where you put the code in these files.

Rather than copy the code shown below, you can get everything you need in a single zip file. Just download it by clicking here.

The code for custom_functions.php

Below is the code to put into your custom_functions.php file. Actually, there are two sets of code: one for the 3-column widgetized footer, and one for the 4-column footer. Both are included in the zip file. You need copy only the code for the number of columns that you want. Don’t put both into your custom_functions.php file!

3-column code for custom_functions.php

If you download the zip file, this code is in the “widgetized footer 3 col.php” file.

/*---------------------------------*/
/* WIDGETIZED FOOTER - 3 COLUMNS */
/* Mike Nichols - October 17, 2009 */
/*---------------------------------*/

/*-----------------------------------------*/
/* register sidebars for widgetized footer */
if (function_exists('register_sidebar')) {
$sidebars = array(1, 2, 3);
foreach($sidebars as $number) {
register_sidebar(array(
'name' => 'Footer ' . $number,
'id' => 'footer-' . $number,
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
}

/*-----------------------*/
/* set up footer widgets */
function widgetized_footer() {
?>
<div id="footer_setup">

<div class="footer_items">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 1') ) : ?>
<?php endif; ?>
</div>

<div class="footer_items">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 2') ) : ?>
<?php endif; ?>
</div>

<div class="footer_items">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 3') ) : ?>
<?php endif; ?>
</div>

</div>
<?php
}
add_action('thesis_hook_footer','widgetized_footer');

4-column code for custom_functions.php

If you download the zip file, this code is in the “widgetized footer 4 col.php” file.

/*---------------------------------*/
/* WIDGETIZED FOOTER - 4 COLUMNS */
/* Mike Nichols - October 17, 2009 */
/*---------------------------------*/

/*-----------------------------------------*/
/* register sidebars for widgetized footer */
if (function_exists('register_sidebar')) {
$sidebars = array(1, 2, 3, 4);
foreach($sidebars as $number) {
register_sidebar(array(
'name' => 'Footer ' . $number,
'id' => 'footer-' . $number,
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
}

/*-----------------------*/
/* set up footer widgets */
function widgetized_footer() {
?>
<div id="footer_setup">

<div class="footer_items">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 1') ) : ?>
<?php endif; ?>
</div>

<div class="footer_items">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 2') ) : ?>
<?php endif; ?>
</div>

<div class="footer_items">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 3') ) : ?>
<?php endif; ?>
</div>

<div class="footer_items">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 4') ) : ?>
<?php endif; ?>
</div>

</div>
<?php
}
add_action('thesis_hook_footer','widgetized_footer');

The code for custom.css

Following is the code for your custom.css file. It is the same for both 3- and 4-column footers. If you download the zip, it is in the “widgetized footer.css” file.

/*---------------------------------*/
/* WIDGETIZED FOOTER               */
/* Mike Nichols - October 17, 2009 */
/*---------------------------------*/

/* footer widget area setup */
#footer_setup {
	/* widgetized footer background (not footer background) */
	background: #EEEEEE;
	/* widget padding */
	padding: 16px;
	/* margin at bottom of widgets */
	margin-bottom: 25px;
	/* do not change this! */
	overflow: hidden;
}

/* widget item setup */
#footer_setup .footer_items {
	/* contents alignment */
	text-align: left;
	/* widget width */
	width: 210px;
	/* space between widgets */
	padding-right: 10px;
	/* text color */
	color: #2361A1;
	/* do not change these! */
	display: inline-block;
	float: left;
	height: 100%;
}

/* widget item headers*/
#footer_setup .footer_items h3 {
	/* font size */
	font-size: 1em;
	/* bold or not */
	font-weight: bold;
	/* uppercase or not */
	text-transform: uppercase;
	/* space out the letters*/
	letter-spacing: 0px;
	/* font color*/
	color: #000000;
	/* padding under header text */
	padding-bottom: 3px;
	/* border under header text */
	border-bottom: 3px solid #ffdf00;
	/* distance between border and widget text */
	margin-bottom: 5px;
}

/* do not change these! */
#footer_setup .footer_items ul li { list-style: none; }
#footer_setup .footer_items ul { margin: 0px; padding: 0px; }

How to use and customize the widgetized footer

The code shown above is ready to run and needs no configuration. However…

Important! Your widgetized footer will not appear until you put at least one widget into it! From your WordPress admin panel go to Appearance > Widgets. Along with the sidebars you will see items for the footer. Just set them up like you would the sidebars. You can put any number of widgets into each footer column, but be aware that this will make your footer very tall.

Customizing the widgetized footer

There are several things that can be customized in the widgetized footer, particularly the headers. You will also want to set width of the widgets. Please note that there are several selectors and properties that you should not change or your footer will look very strange! Following are some of the more common customizations:

1. Background
In Figure 1 the widgetized footer has a white background, and in Figure 2 it has a gray background. You can give it any color background you want, or even display it over an image! The setup for the background is in the first selector, “#footer_setup.” This controls only the background behind the widgets, though. If you want the entire footer section to have a background color, you will need to customize the Thesis “#footer” selector. The code you would use in custom.css looks like this:

.custom #footer {
	height: 400px;
	width: 1018px;
	background: #000000;
}

Change the height and width of the footer area to suit, and of course change the footer color.

2. Width of widgets
The size of the widgets may be too narrow or too wide for your page setup. If too wide, they may even wrap around to a second row. The widget width is set in the “#footer_setup .footer_items” selector. You will have to experiment until you get this right.

3. Color, font and border of the widget headings
These are set in the “#footer_setup .footer_items h3″ selector. The properties are all commented so I will not repeat them here. The most common font customizations are included, but you can add more, such as the font family.

Customizing the widgets in the widgetized footer

The widgets in the widgetized footer are not customized like the ones in the sidebars. Instead, they are governed by the footer’s selectors. The footer’s font color by default is gray and all links are underlined. Following are the footer selectors that apply to the widgetized footer. They are set up with “Thesis blue” links and underlining only when the cursor hovers over a link:

/* footer font styles */
.custom #footer a {
	font-size: .9em;
	border-bottom: none;
	/* default Thesis link color */
	color: #2361A1;
}
.custom #footer a:visited {
	text-decoration: none;
	/* default Thesis link color */
	color: #2361A1;
}
.custom #footer a:link {
	text-decoration: none;
	/* default Thesis link color */
	color: #2361A1;
}
.custom #footer a:hover {
	text-decoration: underline;
	/* default Thesis link color */
	color: #2361A1;
}

Conclusion

Remember you can get the files needed for the widgetized footer in a single zip file. Just download it by clicking here.

I hope this article has been instructive and that you will try out the widgetized “fat” footer on your site! As always, your comments are welcome. If you wish, you can contact me by email by clicking on the “Contact” button in the menu.

©2009 Michael L Nichols. All rights reserved.

What next?

Your comments are always welcome, and are important to this blog’s community! Leave a comment now, or read the comments.

You can find several related articles in the “Related Articles” list below. In the footer you will find a lists of Popular Posts, Recent Posts, and you may browse by Categories, or tags. There’s also a Google Custom Search box to help you find just what you want.

Get free updates by RSS or email!

If you have enjoyed this article, please consider subscribing to article updates, using an RSS reader, or by email. It’s free and is a great way to make sure you don’t miss a single article! I also invite you to follow me on Twitter!

Why not share this article with others!

Share this article with your friends using your favorite social media service, such as StumbleUpon, or Digg. Check out the icons below under “Share This Article With Others” for other social media, including del.icio.us, Technorati, Sphinn, Friendfeed, FaceBook, MySpace andLinkedIn! You can also email or print the article, and even tweet it using Twitter!

Share and Enjoy:
  • StumbleUpon
  • Digg
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • FriendFeed
  • Sphinn
  • LinkedIn
  • Twitter
  • email
  • Print
  • PDF
Related Articles

{ 6 trackbacks }

You Too Can Have a Fat Footer! | Thesis Theme Tools
October 17, 2009 at 3:12 pm
Best Blog Award — Another Piece of the Puzzle
November 7, 2009 at 11:48 pm
Sara Hellman » Foten är på plats
December 2, 2009 at 12:00 pm
250+ Thesis Theme Resources | Sahil Kotak dot Com
December 8, 2009 at 2:28 pm
Thesis theme in play for real
March 5, 2010 at 6:25 pm
New Design
March 7, 2010 at 12:00 am

{ 74 comments… read them below or add one }

DCT Advisors February 17, 2010 at 5:03 pm

Hi there.

I installed the code, but the problem is that the footers are rendering in a single column, one on top of the other. I need them to render in 3 columns across the bottom of the page. Help!

Reply

Mike Nichols February 18, 2010 at 11:19 am

Hi, DCT,

The footers rendering in a single column usually means that the code for custom.css hasn’t been installed. This code tells the footer widgets how to display themselves across the bottom of the screen.

Let me know if this doesn’t solve your problem!

Reply

Tim Hurley February 28, 2010 at 3:34 pm

Hi Mike,

Great tutorial – works like a charm! I’m wondering though – How can I set-up conditional tags to only show widgetized fat footers on certain pages? I’ve been adding conditional tags and the widgets follow the rule but the footer stays fat no matter what.

Reply

Mike Nichols February 28, 2010 at 3:39 pm

Hi, Tim,

Have you tried something like this:

function fat_footer_pages() {
if (is_page(’some page’))
add_action(‘thesis_hook_footer’,'widgetized_footer’);
}

Let me know if this works for you.

Reply

Tim Hurley March 1, 2010 at 8:15 am

Thanks for the reply!

But where in my existing code do I place this? I see I already have:
add_action(‘thesis_hook_footer’,'widgetized_footer’);
Do I wrap the existing code with this one? Or do I add it?

Thanks again…

Reply

Mari-Lyn March 5, 2010 at 10:21 am

Thank’s Mike,
I Love the Widgetized Footer, the instructions are easy to follow and it looks great, leaves your site looking cleaner. I now used it for all my sites.
Mari-Lyn

Reply

Rob - @formerfatguy March 5, 2010 at 11:32 pm

very nice. You’re the first thesis tutorial site I’ve seen and I’m glad to have found you. I have a few blogs and I’m test driving thesis on one of them before I begin using it with clients.

Reply

Gary March 6, 2010 at 11:24 pm

Mike. Great work! Thanks so much! This would have taken forever for me to figure out… IF I ever did. Thanks so much for offering up your help.
Warmest Regards,
Gary

Reply

Dave March 8, 2010 at 12:16 am

Hi Mike,

Great Tutorial, as easy as copy and paste. The only thing though, the Fat Footer is only showing up on my home page, and not the rest of the pages. Is there something I missed?
Any help is greatly appreciated,

Dave

Reply

Mari-Lyn March 8, 2010 at 12:47 am

Hi Mike,

Not sure if this is a foot problem or not..one WP guy thinks it is. One of my one of my sidebars, is floating on the bottom. .footers? It’s the only one that does this. Should I just do a re-install?
http://sedonasocialmedia.com
I have already, unplugged & re-activated the plugins, I don’t use Word. Any suggestions?

Thank you,
Mari-Lyn

Reply

Leave a Comment

  • Visit My Other Site!