How to add more sidebar or widget section : WordPress

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.

Related Posts

from my blog


How To Get Hired as a Remote WordPress Developer in 2025

February 14, 2025

In 2025, with the growing demand for remote development and the constantly evolving web landscape, there are many exciting possibilities to become a remote WordPress developer. You can achieve success...

Hire WordPress Experts: Building Your Online Presence with Confidence

April 10, 2024

WordPress can help you create an online presence that is effective for your company. WordPress is a top-rated content management system. To harness its power, you need WordPress specialists. What...

Why Should Your Hire Freelance Web Developer: The Top Benefits

May 17, 2022

When developing a website or an app, there are two major ways to do it - outsource the job to a web development company or hire a freelancer to get...