Widgeting Themes with Multiple Sidebars
Post Info Saturday, January 31st, 2009 12:40 pm by Cody Print Print this page

Unfortunately, this theme (BloggingPro) was not widget enabled, so some work needs to be done. The Widgetizing Themes tutorial was useful for setting one sidebar, but in my case, there are multiple sidebars. Here is some code to make multiple sidebars widget ready…

First, this theme does not have a functions.php file for theme specific functions. Therefore, I uploaded wp-content/themes/[theme name]/functions.php. The file contains the following:

function.php

<?php
if ( function_exists('register_sidebar') ) {
  register_sidebar( array(
  'name' => 'sidebar_left',
  'before_widget' => '',
  'after_widget' => '',
  'before_title' => '<h2>',
  'after_title' => '</h2>') );
  register_sidebar( array(
  'name' => 'sidebar_right',
  'before_widget' => '',
  'after_widget' => '',
  'before_title' => '<h2>',
  'after_title' => '</h2>') );
}
?>

Next, we need to enable dynamic sidebars. Open wp-content/themes/[theme name]/sidebar.php.

We want to add dynamic sidebars for the div classes SRL and SRR. Different themes will use different names for sidebars div class names, so it may not look the exact same, but the concept is the same. After
<div class="SRL"> add:

 <?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar('sidebar_left') ) : ?>

Right before the ending <div&gt for <div class="SRL"> add:

<?php endif; ?>

Similarly, do the same for the right side bar. After
<div class="SRR"> add:

 <?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar('sidebar_right') ) : ?>

Right before the ending <div&gt for <div class="SRR"> add:

<?php endif; ?>

Now your theme is widgetized!

3 Responses to “ Widgeting Themes with Multiple Sidebars ”

  1. David

    Or there is the Widget Ready version: http://www.bloggingpro.com/archives/2007/03/23/widget-ready-blogging-pro-theme/ :)

  2. MICHEAL


    CheapTabletsOnline.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. High quality pills. Order pills online

    Buy:Female Pink Viagra.Buspar.Prozac.Nymphomax.Acomplia.Lipothin.SleepWell.Aricept.Amoxicillin.Female Cialis.Ventolin.Wellbutrin SR.Cozaar.Zetia.Zocor.Advair.Lasix.Lipitor.Benicar.Seroquel….

  3. EDWARD


    CheapTabletsOnline.Com. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. Low price drugs. Order drugs online

    Buy:Prozac.Ventolin.Female Pink Viagra.Aricept.Benicar.Zetia.Advair.Zocor.Female Cialis.Lipitor.Wellbutrin SR.Lipothin.Nymphomax.SleepWell.Cozaar.Buspar.Seroquel.Amoxicillin.Acomplia.Lasix….

Leave a Reply

Get updates as often as we post! Subscribe to our full feed or comments feed.