Add a widgetised footer to WordPress

How to: add a widgetised footer with columns in WordPress

One of my favourite features of both Biblioteca and WPShout has to be the footer. With three columns and being widget ready, it’s pretty awesome!

How do you create something like this? It’s actually pretty simple. First, you need to create the boxes with some CSS. I’m sure I’m doing this really inefficiently, but hey nevermind. Do it this way and it’s easier later on to replace a box with a widened other box.


.footerinside {
	width:292px;
	padding:10px;
	float:left;
	margin:10px 10px 10px 0;
	background:#fff;
	height:460px;
}
.footerinside p {
	font-style:italic;
	color:#555;
	font-size:80%;
}
.footerinside li {
	margin-left:20px;
	padding:5px 0;
	list-style:square;
	}

.footerinsideright {
	width:292px;
	padding:10px;
	float:right;
	margin:10px 0 10px 0;
	background:#fff;
	height:460px;
}

.footerinsideright p {
	font-style:italic;
	color:#555;
	font-size:80%;
}
.footerinsideright li {
	margin-left:20px;
	padding:5px 0;
	list-style:square;
	}

Next, open up your footer.php file and add the following:

 <div class="footerinside">
		<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Left') ) : ?>
		<h3>Widgetised area</h3>
		<p>This is a widgetised area. To fill it with 'stuff', use the Footer Left widget</p>
		<?php endif; ?>
	</div><!-- end footer left -->

	<div class="footerinside">
		<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Center') ) : ?>
			<h3>Best of <?php bloginfo('name'); ?></h3>
			<p><b>The best of <?php bloginfo('name'); ?></b> - the most commented posts.</p>
		<p>This is a widgetised area. To fill it with 'stuff', use the Footer Center widget</p>

		<?php endif; ?>
	</div><!-- end footer central -->

	<div class="footerinsideright">
		<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Right') ) : ?>
		<h3>Widgetised area</h3>
		<p>This is a widgetised area. To fill it with 'stuff', use the Footer Right widget</p>
		<?php endif; ?>
	</div><!-- end footer right -->

What we’ve just added are three widget ready areas to our footer. You’ll need to activate these widget ready areas using the functions.php file, as we discussed last week:

if ( function_exists('register_sidebar') )
    register_sidebar(array(
		'name' => 'Footer Left',
	    'before_widget' => '',
        'after_widget' => '',
        'before_title' => '<h3>',
        'after_title' => '</h3>',
    ));

	if ( function_exists('register_sidebar') )
    register_sidebar(array(
		'name' => 'Footer Center',
        'before_title' => '<h3>',
        'after_title' => '</h3>',
    ));

	if ( function_exists('register_sidebar') )
    register_sidebar(array(
		'name' => 'Footer Right',
        'before_title' => '<h3>',
        'after_title' => '</h3>',
    ));	

And with that, we’re done! You’ve now added to your WordPress theme an awesome three column footer which is widget ready! Any questions, feel free to leave a comment. And want a theme with this built in? Check out Biblioteca.

You should follow me on Twitter

Related Posts

Add Columns to Your Posts!

The Death of the Boring Blog Post – Easily Add Columns to Any WordPress Post


Basics Of WordPress Theme Design

Basics Of WordPress Theme Design


WPShift

7 Comments - Add Yours!

  • Ashfame wrote on October 2, 2009 at 4:43 pm | Permalink

    Yes its pretty easy to widgetise any area you want.
    .-= Ashfame´s last blog ..Fix bb_attachments plugin of bbPress =-.

  • Simon Wells wrote on October 12, 2009 at 7:26 pm | Permalink

    Hey great tutorial.
    I am trying to get this to work on my Concept theme.
    Now, I have managed to get the widget areas to appear with selected test widgets, but no matter what I do, I just can’t get it to appear in the footer, it just places it in the right sidebar.

    Next step is to try and get it to be styled like the right sidebar widget area, using the top, side and bottom images.

    Will let you know, if I ever get it up and running.

  • Simon Wells wrote on October 12, 2009 at 10:53 pm | Permalink

    Just an update, with a bit of tweaking to my css, I have now got my 3 widget areas in the footer.
    Thanks for such a useful tutorial.
    .-= Simon Wells´s last blog ..New Site Launch =-.

  • Si wrote on January 19, 2010 at 7:26 pm | Permalink

    I’m trying to get this to work on my site but having problems.

    IS the code above additional to the code already in my footer/css files, or should I just replace current footer code with the above?

    Thanks

  • Si wrote on January 19, 2010 at 8:20 pm | Permalink

    Managed to get the footer to work – but now it is dragging in the same content as my other three sidebars…

    • Alex Denning wrote on January 20, 2010 at 5:11 pm | Permalink

      Did you change the name of the widget area?

  • RozaniGhani wrote on February 25, 2010 at 9:41 am | Permalink

    This tutorial is very good. Its very good for non license template to modify. However, licensed template cannot edit footer intact. I’m going to solve my template using your code.

One Trackback

Post a Comment

Please take not of the comment policy.

Your email is never published nor shared.

*
*
User Gravatar