How to Add Widgets to WordPress Theme’s Footer
Categories: Wordpress
I wanted to use widgets in the footer of my WordPress theme but my wordpress theme didn’t come with a footer-sidebar by default. I didn’t really wanted to change the theme just because of that. So I hacked the wordpress theme to introduce footer-sidebars. If you are looking for a tutorial that explains how you can add sidebars/widgets to the footer of your WordPress theme then keep reading.
![]()
There are really three main parts to introducing a footer-sidebar
1. Registering the Sidebars in the WordPress Theme
2. Inserting the Sidebars In the WordPress Theme
3. Putting some style into the sidebars
1. Register the Sidebars in the WordPress Theme
Go to the WordPress theme editor and open the Theme Functions (functions.php) file. Now Search for the following line in your Theme Functions (functions.php)
if ( function_exists('register_sidebar') )
Once you find the above line then take a look at the the next line which should look similar to one of the followings depending on how many sidebars you have:
register_sidebar(array(
or
register_sidebars(2,array(
Say for example you have one sidebar in your theme and you want to add three rows of sidebars in the footer area so you can put widgets then overwrite the code with the following:
register_sidebars(4,array(
The above will register 4 sidebars (one that you already have and three more that you are about to introduce in the footer area of your wordpress theme).
2. Insert the Sidebars In the WordPress Theme
Now lets insert the siderbars where we want them in the WordPress theme. In our case we are going to insert in in the footer area of the theme so open the Footer (footer.php) file and insert the following code just above the ‘footer’ division:
<div id="footer-sidebar" class="secondary">
<div id="footer-sidebar1">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
<?php endif; ?>
</div>
<div id="footer-sidebar2">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>
<?php endif; ?>
</div>
<div id="footer-sidebar3">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(4) ) : ?>
<?php endif; ?>
</div>
</div>
<div style="clear-both"></div>
3. Put some style into the sidebars
Finally, lets put a little style to all the ‘footer-sidebar’ divisions that we just introduced. Open the Stylesheet (style.css) file and insert the following CSS (you will probably have to adjust the CSS to your need depending on what wordpress theme you are using).
#footer-sidebar {
display:block;
height: 250px;
}
#footer-sidebar1 {
float: left;
width: 340px;
margin-left:5px;
margin-right:5px;
}
#footer-sidebar2 {
float: left;
width: 340px;
margin-right:5px;
}
#footer-sidebar3 {
float: left;
width: 340px;
}
Hope this helps! Now you don’t have to change your beloved WordPress theme just to get footer-sidebar ![]()
Articles you may also like:









#1 by liryc on January 27, 2012 - 10:20 pm
Wow, thank you very much, this is what I’ve been looking for, I am now editing my template.
Keep it up!
#2 by Jimmy on December 19, 2011 - 10:20 pm
Thanks for the help. Worked out perfect.,
#3 by aero on December 15, 2011 - 7:55 am
I love to tackle problems like these and i was going to try and solve this myself but you beat me to it
and saved me a lot of time. Thanks! I have a nice theme and wanted to display weather forecast widget in the footer and it works perfectly.
#4 by JJSWP on December 14, 2011 - 5:43 pm
Thanks, this worked very well for me. I just had to tweek the code a bit by putting the named dyanamic widget as opposed to number assignments.
Thank you
#5 by Jamil on November 26, 2011 - 4:29 am
Good artilce specially for beginners. Now i have learnt the art of adding widgets in footer as well. Will implement it in my next theme.
Thanks
#6 by Magento development on November 18, 2011 - 6:13 am
Really great tips. As i want to learn wordpress so this post might help me…
#7 by Anuj@wpblogtips on November 10, 2011 - 3:29 am
That was a simple code trick, and yet so many people find it difficult. We used tables for so long to get that effect. Thanks.
#8 by Robin on November 4, 2011 - 2:27 pm
Pretty useful to setup a widget at the footer. Great write up as well.
Robin.
#9 by welders on November 2, 2011 - 12:25 am
Thank you. I have stuffed around with the footer for hours, now all sorted thanks to your info.
#10 by Templates on October 23, 2011 - 2:20 am
Awesome, thank you !! i only just started learning wordpress, mostly ive been working with forum software and release free forum skins etc but now i can release free wordpress themes as well.
Cheers
#11 by Philippines Virtual Assistant on October 5, 2011 - 5:15 am
I’ve been looking for almost 30 minutes regarding how to add footer-sidebar and your post has the easiest and simplest way to do it.
Thank you so much your such a life saver
-Damien Lewis.
#12 by Lusi on October 4, 2011 - 12:06 am
Thank you a lot. The tutorial provided is clear enough.
I try it now.
#13 by jewel on October 1, 2011 - 3:50 pm
I’ve some problem with the footer widget. But finally I’ve solve my problem. Thank you very much.
#14 by Chelle on September 27, 2011 - 3:38 am
Worked beautifully
Thank you for the easy step by step copy and paste instructions 
#15 by Kulwant Nagi on September 22, 2011 - 4:11 am
This tutorial Really helps me a lot.. thanx a lot because i found this tutorial after too much search…
#16 by Vijay on September 12, 2011 - 11:02 pm
Pretty Simple Huuh. I thought it would be difficult, Thanks for sharing.
#17 by aya on September 3, 2011 - 10:31 pm
Scratch that! I added just above the footer sidebar div, and it cleared up that mess! Thank you so much once again… this tutorial made my theme one that will grow with me and cover my needs for a good deal of time
#18 by aya on September 3, 2011 - 10:26 pm
Thank you so much for all your help! I have it working and it has a background, I think it looks MARVELOUS and I am so happy!
May I ask for one last bit of advice? The footer looks great on all my pages, but it goes a little wonky on my front page : http://www.strawberrykoi.com
The footer background disappears, the whole thing seems shortened and the top of the footer BG is popping up at the top of my slider. Is this a footer.php issue or…? Any thoughts would be greatly appreciated!!!
#19 by Paul on September 1, 2011 - 10:25 pm
I like the way your tips and tricks tutorials cover every aspect of web blogging. You can find everything a newbie needs and all the details a power-user requires. This article is a perfect example. One of those simple things that I as an experienced programmer spend far too much time explaining to novice users. Now I can simply point them to this page and be done with it.
#20 by admin on August 30, 2011 - 11:26 pm
@aya, add your image as the background for the “footer-sidebar” div.
#21 by aya on August 30, 2011 - 4:45 pm
Thank you so much for this guide!!! You LITERALLY saved me $500 with only 10 minutes of work. I have one question How do I assign the whole footer a background image/color?
Thanks again!!!
#22 by SwaEgo on August 30, 2011 - 12:13 am
Thank you very much. Just what I needed
#23 by Mark on August 17, 2011 - 4:19 am
Thank you so much for this tutorial! Im creating my own themes and this just made things a lot easier!
#24 by wide angle macro lens photography on August 14, 2011 - 2:03 pm
i got the extra sidebars to work.. thanks.. but have trouble expanding my present website layout.. sigh.. great post and great help!
#25 by jangkrik blog on August 14, 2011 - 1:40 pm
footer sidebar is very useful, thanks for tutorial.
#26 by Jill on July 26, 2011 - 11:51 pm
This might have been the easiest thing I’ve ever done! Thanks!
#27 by moderngadget on July 4, 2011 - 3:16 am
thanks for tutorial. helping me to make footer widget
#28 by Anuj on July 1, 2011 - 12:26 pm
wow it is easy
#29 by Webite SEO Services on June 23, 2011 - 10:31 pm
Excellent tips – I did find it helpful
#30 by design on June 15, 2011 - 10:23 am
great, thank you!
#31 by Mikey on May 22, 2011 - 9:29 am
i was thinking to change theme to get widgets in footer, but now will use this post to make in my current theme
Thanks alot
#32 by simon on May 14, 2011 - 10:54 pm
hey thanks for this post…I was looking for it
#33 by Timothy on May 14, 2011 - 9:44 am
Seems simple enough – though I would have never figured this out on my own, nice little theme hack I am sure a lot of people will find it useful
#34 by Conservation Jobs on April 4, 2011 - 8:39 am
Really useful code, I hope I can get it to work on my blog! Thanks, Jon.
#35 by Mark Waugh on March 16, 2011 - 6:38 am
Excellent WordPress sidebar registration post. The concept look more helpful for use widgets in the footer of my WordPress theme. Thanks!
#36 by Tiago Araujo on March 14, 2011 - 1:27 am
I am using a theme that has a slight different structure, but I could make it work anyways. Thanks for the post!
#37 by boim on March 4, 2011 - 9:29 am
nice tutorial…i’ll try it !!
#38 by Barbara on February 13, 2011 - 3:09 am
will the incorporate this into my footers on a few of my sites
#39 by Kevin on February 3, 2011 - 6:53 pm
I just started using wordpress this week with a free business theme and wanted to add more home page text widgets instead of the side bar widgets. It took some figuring but with the help of your instructions I got it and it looks exactly how I wanted!
Thanks for the great help!
#40 by Richard on February 2, 2011 - 8:52 am
I was looking at how to make a few changes to my WordPress theme and struggling quite a bit with this footer issue. This article led me in the right direction. Many thanks, Richard
#41 by teddy on February 1, 2011 - 4:38 pm
Thank you for the tutorial. I’ve just finished testing it on another website, I think I’ll implement it in my footer as well. Thanks again.
#42 by Bella on January 6, 2011 - 12:14 pm
This is brilliant. I have limited coding skills but using your straightforward instruction managed to tweak my functions.php to add two footer sidebars to the scribblings theme. Brilliant.
My site is still under construction but feel free to take a look. Once it’s all finished I may post about your tips.
#43 by Nick on January 3, 2011 - 5:58 pm
you made my day
#44 by John Gamings on January 3, 2011 - 11:03 am
For some reason I am not able to get the new sidebars to show up in the admin portion to drag the widgets into it. Other than that though, it seems to be working perfectly
#45 by LacyG on December 9, 2010 - 8:41 am
Just what I needed, thank you.