Click here to get The Blog Profits Blueprint

How to add a sidebar

Blogging Tips, Wordpress September 5th, 2007

    Visited 12698 times, 1 so far today

I’ve had a few people asking how they can add a second column sidebar to a one column wordpress theme. To do this you will need to edit the template files index.php, archive.php, page.php and single.php.
Here is the code with step by step instructions. Before you begin you will need to decide where you want the sidebar.

  1. Login to your WordPress administration panel
  2. Select Presentation ->Theme Editor from the navigation menu
  3. On the Theme Editor page, you will see a list of “theme files” to the right of the page. Select the “main index template” (index.php).
  4. Copy and paste the following code before the last </div> of the <div id=”primaryContent”> and before <?php get_footer(); ?>. This will ensure the sidebar appears above the footer.
    <?php get_sidebar(); ?>
  5. Save
  6. Still on the Theme Editor page, select the “sidebar template” (sidebar.php).
  7. Add the following code after the last </div> of the left or right sidebar
  8. <div class=”right-sidebar”>
  9. Save
  10. Now open the style sheet (style.css) and style it up how you want it to match the theme. For example
    .right-sidebar {
    The best thing to do is to see how your other sidebar is styled and copy that code just changing the left or right wording.
  11. Save

You can view your site now and you should be able to see the new sidebar added to your main home page. You need to now repeat the above steps 1- 5 on the following template files:
archive.php – this will show the sidebar on all your category pages
page.php – this will show the sidebar on all your pages you create in WordPress
single.php – this will show the sidebar on every single post

That’s it your done! Feel free to comment if you have any questions.

Read the Comments

[ # 1414 ] Pingback from The Sharing and Caring of the WordPress Community Shines « Lorelle on WordPress [December 24, 2007, 12:38 pm]

[...] Bloggerholic – How To Add A Sidebar To Your WordPress Blog [...]

MyAvatars 0.2



FREE Newsletter

Sign up TODAY and get FREE Tips every Week on Making Money on the Internet 

Recommended Book


Tag Cloud

Wordpress Blog Marketing Blogging Tips Blogging Tools and Services Advertising VoIP Blogging for Money Search Engine Optimization Adsense General

Recommended Money Makers

      Text Link Ads
      Blog Mastermind Affiliates
      Amazon Associates

Related Articles

Post-Plugin Library missing

Recent Articles