How to Activate an Inactive Sidebar in WordPress?

Switching between themes is quite common for WordPress users. Whenever you change any theme, not all the features of the older theme can fit in the new theme. Inactive Sidebar is the result of changing a theme. The sidebar that was available earlier in the previous theme will stay as an inactive sidebar in the new theme. Especially, those custom sidebar which is added by users and not by default can go inactive. This happens because the old sidebar is not registered for the new theme. Here are the solutions for the problem of how to activate an inactive sidebar in WordPress.

How to Activate an Inactive Sidebar in WordPress?

Drag and Drop the Widgets

This is the easiest thing you can do. First, go to Appearance > Widgets from your WordPress dashboard. If you have both active and inactive sidebar in your widget area then you can drag and drop the widgets from the inactive sidebar to the active sidebar. This will move the widgets along with its settings to the current sidebar.

How to Activate an Inactive Sidebar in WordPress?

This should be enough to display the contents of the widget in your sidebar in the front end of your website.

Activate the Specific Sidebar

May be the inactive sidebar is special to you and want to activate that particular sidebar. Or may be the drag and drop solution does not fit in your case. Then you can actually activate that particular sidebar too.

Each sidebar or any widget area is identified by their id. You actually have to register the specific inactive sidebar using the specific id. To register the inactive sidebar, you may have to copy and paste the following code in our new theme’s functions file. To find function file go to Appearance > Editor and search for functions.php file from right side’s template files. Here is the code to copy.

function awsome_widget_setup(){
    register_sidebar(
        array (
            'name' => 'Sidebar',
            'id' => 'sidebar1',
            'description' => 'Custom Sidebar to display widgets',
            'before_widget' => '<div class="widget-content">',
            'after_widget' => "</div>",
            'before_title' => '<h3 class="widget-title">',
            'after_title' => '</h3>',
            )
    );
}
add_action('widgets_init','awsome_widget_setup');

The id of above sidebar is sidebar1. You have to find the specific id of your inactive sidebar. To find the id of your inactive go to functions file of the previous theme and search for words like register_sidebar.  Identify your inactive sidebar code and note the id. Replace the above id sidebar1 with your id and save the changes. For now, let’s assume the id of your inactive sidebar is sidebar1. Now this will bring your inactive sidebar to active section.

Displaying newly active sidebar in the front end of your website

Although your inactive sidebar is turned into the active sidebar in the dashboard, it may not be displayed in the frontend. To display the sidebar on the website, paste the following code in your Sidebar.php file or in any file where you want the sidebar to be displayed.

<?php if ( is_active_sidebar( 'sidebar1' ) ) : ?> 
    <?php dynamic_sidebar( 'sidebar1' ); ?>
<?php endif; ?>

Don’t forget to replace the sidebar1 with your sidebar id.

How to display sidebar if some pages in your theme do support any sidebar at all?

Sometimes the page layout of some of the pages in your theme does not support sidebar. If you still want to display sidebar in those pages then you can perform the following trick.

  1. Login to WordPress admin dashboard navigate to Pages > All Pages
Also Read:   How to Fix Parse Error: Syntax Error in WordPress

page-all page

2. Select the page where you want the sidebar to appear. You can select the edit link of the page.

3. On the right-hand side of the edit page screen, you can see the layout meta-boxes. These meta boxes may or may not be present according to the theme you are using. In the layout meta-box, select the 2 column layout with a sidebar. If you have the sidebar meta-box, then you can also select the specific sidebar from multiple sidebars to appear on that page.

page-setting

  1. If you don’t find layout meta-box. Click Screen Options at the top of the page and select the layout check box as shown in the image.

  1. Finally, click the update button to save the changes.

Many themes may not support sidebar at all. You may not find the layout option meta-box at all. In these cases, you can contact the theme support team or switch to any other sidebar supportive theme.

Deleting inactive widgets: If you have many inactive widgets deposited which you are sure you will never use then you can delete those widgets. You have to manually click each widget and click delete.

Conclusion

When you try out the different themes and worked with many plugins, the inactive widgets get deposited in your inactive widget area. This happens to save your widgets while changing themes. The inactive widget is the feature of WordPress so you can keep the settings of widgets you have used while not having them in a sidebar area. We hope this article on how to activate an inactive sidebar in WordPress, has helped you in solving the issue related to inactive widgets. We actually have a very good article on “How to add a Custom Sidebar in WordPress“.

The following two tabs change content below.

Kantiman Bajracharya

Kantiman Bajracharya is a freelance web developer. He is a computer geek who has a Bachelor’s degree in Computer Engineering. He has earned lots of satisfied customers while working for numerous successful projects. He is also a WordPress theme creator and web article writer. On free time he likes reading philosophy books, traveling and playing chess.

Share This Post