Today i am writing how to add widget footer in wordpress Blogs.
So, For that first we have edit functions.php. we needed to tell WordPress to insert new sidebars into theme by altering the footer.php file.
Edit functions.php:
Add the following code in functions.php:
<?php
if ( function_exists('register_sidebar') )
register_sidebars(5,array(
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
?>
Now the architects have drawn up their plans, the construction team come in to put the new sidebars in place. They need to build the new “sidebar” elements into the footer.
Edit footer.php:
Now Find this code in footer.php
<div id="footer">
And immediately ABOVE/BEFORE it, Add the code:
<div id="footer-sidebar" class="secondary">
<div id="footer-sidebar1">
<?php if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar(3) ) : ?>
<?php endif; ?>
</div>
<div id="footer-sidebar2">
<?php if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar(4) ) : ?>
<?php endif; ?>
</div>
<div id="footer-sidebar3">
<?php if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar(5) ) : ?>
<?php endif; ?>
</div>
</div> <!-- Close footer-sidebar -->
<div style="clear-both"></div>
That done, when your site loads, the builders come in and add the sidebars into the footer.
Now, Now we need some interior designers to add a bit of style and finesse.
Edit style.css:
Add the code to style.css
#footer-sidebar {
border: 1px solid #cccccc;
display:block;
height: 260px;
}
#footer-sidebar1 {
float: left;
width: 300px;
margin-right:20px;
}
#footer-sidebar2 {
float: left;
width: 300px;
margin-right:20px;
}
#footer-sidebar3 {
float: left;
width: 300px;
}
Now your are completely done with widget footer in your wordpress blog.













Thanks for sharing this code for adding footer widgets
is it possible to add 4th widget with just adding:
?
thanks