How to use multiple sidebars in the Revolution Theme

The Revolution wordpress theme by Brian Gardner is the basis on which this website is built. A question has been raised as to how one goes about using multiple side bars or dynamic areas to display widgetised content:

Featured Page Areas


Custom Featured Pages and Sidebars

This is the process that I developed for this site (please note that this works for the self-hosted version of WP only) for increasing the number of wigetised sidebars, on ‘featured pages.’

There are few items you will need

  1. Access to your Blog directory structure from an FTP client such as Filezilla
  2. Text editing software such as Notepad

The structure of Revolution

  1. Login to your site
  2. Go to Presentation
  3. Click on Theme Editor
  4. Navigate to functions_php and you will see:
    <?php
    if ( function_exists(‘register_sidebars’) )
    register_sidebars(4);
    ?>
  5. This means that there are 4 sidebars available
  6. Navigate to featured_page.php and scroll to the bottomof that section where you will see:<?php include(TEMPLATEPATH.”/sidebar_page.php”);?>
  7. This means that a featured page is calling ’sidebar_page’ to display any dynamic content
  8. So navigate to sidebar_page.php, where you will see:
    <!– begin sidebar –><div id=”sidebar”><?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(2) ) : else : ?><h2>Text Area #1</h2>
    <p>This is an area on your website where you can add text. This will serve as an informative location on your website, where you can talk about your site.</p>
  9. This means that if there is something in ‘dynamic_sidebar(2)’ then display it or if not then display the text below
  10. What is ‘dynamic_sidebar(2)’ ?
  11. Navigate to your Widgets area and you will see this
    Revolution Sidebars
  12. Sidebar 2 which has the Next Gen plugin in it already is what dynamic_sidebar(2)’ refers to. You can also see 4 spare sidebars to use as well. Note, Sidebar 1 is used as the call for the blog page
  13. The next step is to create additional custom featured_page templates which call on custom sidebar_pages to display content from any of the 4 available dynamic sidebars

Download

  1. Open up access to your blog through your favourite FTP software and navigate to: wp-content/themes/revolution/page_featured.php and download page_featured.php file to your computer
  2. Then navigate to wp-content/themes/revolution/sidebar_page.php and download sidebar_page.php file to your computer

Sidebars

  1. Navigate to sidebar_page.php and open; then within your text editor and find this section:
    <?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(2) ) : else : ?>
  2. Now change dynamic_sidebar(2) to the number of the sidebar you want, so for example if you wanted to duplicate the blog page sidebar change the 2 to a 1
  3. At the same time you may wish to change the text below or not as the case may be
  4. Save this file as sidebar_[yourname].php

Featured Pages

  1. Navigate to page_featured.php and open; then within your text editor and find this section:
    <?php
    /*
    Template Name: Featured Page
    */and change ‘Featured Page’ to ‘[yourname] Page’
  2. Then scroll to the bottom of the page until you see this:<?php include(TEMPLATEPATH.”/sidebar_page.php”);?>and change ’sidebar_page.php’ to ’sidebar_[yourname].php’ that you prepared in step 4 in the previous section
  3. Save this file as page_[yourname].php that you prepared in step 1 of this section

Upload and Present

  1. Upload these 2 new files to wp-content/themes/revolution/
  2. Go to Presentation
  3. Click on Theme Editor and you will then see your new sidebar and featured page templates at the bottom of the list
  4. Now create a new page and when setting it up choose the correct template (you can see I have quite a few)
    New Page template
  5. Now when you publish that page it will appear with the sidebar you selected

Variables

  1. To change what is displayed in a sidebar just navigate to your widget area and drag and drop the widgets as you see fit
  2. You can obviously have as many page_featured.php as you wish, each calling different sidebars
  3. You can also have as many page_sidebars.php as you wish
  4. You can also set-up page_featured to not have any sidebars by removing the<?php include(TEMPLATEPATH.”/sidebar_page.php”);?>

If you would like to learn how to add widgets to the dynamic area then take a look here

show hide 3 comments

March 24, 2008 - 9:06 pm

Steve - I agree. Clear, concise. Exactly what I was looking for. Thank you for taking the time to explain how to add separate sidebars to separate pages.

January 27, 2008 - 8:43 pm

Guy - Hi Judy

thank you for your kind words. Could you give me a bit more detail on your question? Are you looking to change the way in which the Blog section appears?

January 23, 2008 - 10:20 pm

jacob - hi,
i find your tutorials very useful. i refer to them time and again.

could you kindly sole one doubt?
is it also possible to have templates for the different posts.

i believe the current template in use is the main index template.
Can we alter this or can we have another template?

I hope you are not bothered by the length of these questions.
I will wait for your response.

Thanks,
Judy

Your email is never published or shared. Required fields are marked *

*

*

There was an error submitting your comment. Please try again.