How to add more sidebar or widget section : WordPress
November 22, 2011
Wordpress sidebar has many feature and we can customize that just drag and drop widgets. If we talk about developer end, we can use widget feature to customize our blog. We can as many as side bar and can manage from admin. For example, if we want to add feature in footer where we can manage the important links. Some developer do same thing without adding new widget section. They just insert links in footer.php. But it can be done easily and we can manage it from widget.
below are the step to add new sidebar:
1) Opne function.php which will be located on your theme, if not there just make.
2) Just need to insert below code between php tag (<?php ?>)
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name'=>'widget_section_name',
'before_widget' => ' ',
'after_widget' => ' ',
'before_title' => ' ',
'after_title' => ' ',
));
}
3) Above code will register a new widget section. Now its time to call it in our theme.
4) You make a new php file like footer-link.php or directly insert the below code in where you want to add new sidebar
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('widget_section_name) ) : ?>
<?php endif; ?>
5) Its Done. Now you can use new widget section.