Sometimes it is required to display a suitable, separate sidebar on certain pages on the website. Apart from the default sidebar provided by the theme, you can create a custom sidebar and display it on particular pages with display rules.
To add custom sidebar you need to use Lightweight Sidebar Manager plugin, which is free and available on W.org
This plugin will replace the theme’s default sidebar with the custom sidebar. It also allows replacing widget areas in header or footer. If you have plugins that provide their own widget area like WooCommerce, this plugin allows replacing those widget areas as well.
Below are the steps to use Lightweight Sidebar Manager plugin –
1. Install and activate the plugin on a WordPress site.
2. Settings can be found under Appearance > Sidebars.
3. Add New sidebar and enter a title for your custom sidebar.
4. Fill sidebar settings.
- Sidebar To Replace: Select the sidebar or widget are you wish to replace. All available sidebar and widget areas in the theme will be listed here.
- Description: Add description for your custom sidebar. This is optional.
- Display On: Choose whether to display custom sidebar on the entire website or on specific pages/posts. You can even exclude particular page/post by adding them to Exclusion Rule.
- User Roles: You can decide a user role for which custom sidebar should be visible. For excluded users, the default sidebar set with the theme will be visible.
5. Above steps will register the custom sidebar on site. This custom sidebar will appear under Appearance > Widget.
6. Add widgets to this custom sidebar. Drag and drop the widgets you want to add to the custom sidebar.
7. That’s it! Your custom sidebar will appear on pages/post/widget areas you selected with display rules.
Check following things if you are not able to see custom sidebar –
1. Default sidebar is enabled from the theme. As custom sidebar replaces default sidebar, it needs to be enabled from the theme.
2. If you have selected the sidebar to display on the header/ footer, check if the widget area is enabled for header/footer. Custom sidebar replaces the widget area in the header/footer so you need to enable it.
USING LIGHTWEIGHT SIDEBAR MANAGER PLUGIN WITH THEME
Below is the example that shows how to add a custom sidebar to primary header –
1. Install and activate the theme and Lightweight Sidebar Manager plugin.
2. As we need to set a custom sidebar in the primary header, we need to add the widget area in the header. To add widget area navigate to Appearance > Customize > Layout > Header > Primary Header > Last Item in Menu and select Widget from the list.
3. Now follow the steps that are mentioned above to use Lightweight Sidebar Manager plugin.
4. This will add a custom sidebar to Header. For the demo, we have added image gallery widget to the custom sidebar as shown in the screenshot below –
5. Similarly, you can add a sidebar to the footer and other sections of header.