How to add widgetized and custom sidebars on WordPress theme

WordPress themes are usually come with Widgetized sidebars where you can drag and drop widgets. It’s okay when we don’t need more widgetized sidebars to the theme, but we probably think to add more when we think widgetized sidebar solution to your customization problem, for instance you want to add a banner ad to header area or footer area. This requires coding solution in few themes and each theme could have different solution.
This plugin, Custom Sidebar provides easy solution. The installation is straightforward, we can download from wordpress.org,  upload it to wp-content/plugins directory and activate the plugin in the plugin menu panel or Add New and search Custom Sidebar from the plugin menu panel

Now, we want to add new widgetized sidebar (or in this case widgetized area).  I want to show a Banner Ad with Text Widget dragged and dropped to the new widgetized sidebar/area.

1. Create new sidebar in the Custom Sidebar panel, type name and description and click Create Sidebar. I make a sidebar name Footer: Banner Ad

CS New Sidebar
2. Go to Widgets panel, see that the newly created sidebar name Footer: Banner Ad  is at the bottom of Sidebars
3. Drag and drop text widget to the Footer: Banner Ad sidebar, copy and paste your banner ad code

CS: Text Widget
4. Add following code to a theme file, e.g footer.php.

<?php if (function_exists('dynamic_sidebar')) { dynamic_sidebar('Footer: Banner Ad'); } ?> 

Comments

2 responses to “How to add widgetized and custom sidebars on WordPress theme”

  1. Hello, thank you for your useful article; I wonder what if I export my edited theme? I mean that plugin is needed for installing the edited theme in another wordpress website? Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: