How to add an additional left and right sidebar on wordpress

This post may not be gaming related but can be useful for website owners who wants an additional sidebar on their wordpress blogs.

It’s like showing a different arrangement of your sidebar in different areas of your blog , It can be useful if you like some elements of your sidebar not visible on some parts of your website.

This tutorial is for themes which already had a sidebar in-use but want to show another arrangement of their sidebar on other parts of their blog including, archives, search results, main index, single post, 404 template and so on.

I achieve this by just experimenting on my theme until I figure it out. I don’t seem to find any related articles about it and that only shows that only a few or maybe none are interested on a blog that works like this.

but for individuals who’s looking for a way to achieve a similar task, hope this helps .. Enjoy!

ok let’s begin …

first backup the wordpress theme you’re using , so if ever a problem occur while doing this task, you can revert back your site to its original look.

you can do that by logging in to your webhost using your favorite ftp client,

after you backup your theme, now download the sidebar you want to duplicate into your desktop.

example: sidebar-left.php

rename it so it will become sidebar-left-2.php

next step is to upload it back to your website folder , by still using your ftp client .

now login to your wordpress blog,
now you must have both sidebar-left.php and sidebar-left-2.php under your Dashboard>Apperance>Editor.

open sidebar-left-2.php and look for this line of code

how-to-add-an-additional-left-and-right-sidebar-on-wordpress-photo-2

then change it to

how-to-add-an-additional-left-and-right-sidebar-on-wordpress-photo-3

update file and go to themes functions (functions.php)
to register your sidebar-left-2 so you’ll see it
on your widgets.

open the functions.php and go down until you see this line of code

if ( function_exists(‘register_sidebar’) )

register_sidebar(array(‘name’=>’Left Sidebar’));
register_sidebar(array(‘name’=>’Right Sidebar’));

now add this code below the last line

register_sidebar(array(‘name’=>’Left Sidebar 2’));

so it will look like this

if ( function_exists(‘register_sidebar’) )

register_sidebar(array(‘name’=>’Left Sidebar’));
register_sidebar(array(‘name’=>’Right Sidebar’));
register_sidebar(array(‘name’=>’Left Sidebar 2’));

click update file, now go to your stylesheet or style.css
and look for the code which is responsible for the look of your sidebar.

it you see a line of code like this

#sidebar-left {

you’re on the right track.

NOTE: it may differ on what wordpress theme you are using

but for the theme that I’m using right now, the css code for my left sidebar is like this:

#sidebar-left {
width: 200px;
margin: 0;
padding: 5px 0;
float: left;
font-size: 11px;
overflow: hidden;
}

I just copy and duplicate this line of code
and I rename the

#sidebar-left {

to

#sidebar-left-2 {

so it will look like this

#sidebar-left {
width: 200px;
margin: 0;
padding: 5px 0;
float: left;
font-size: 11px;
overflow: hidden;
}

#sidebar-left-2 {
width: 200px;
margin: 0;
padding: 5px 0;
float: left;
font-size: 11px;
overflow: hidden;
}

click update file, go to your dashboard>appearance>widgets, now you’ll see that you have “sidebar left 2” added as a dropdown menu on your current widgets ,

how-to-add-an-additional-left-and-right-sidebar-on-wordpress

choose and click show, put all the widgets you want to include in this sidebar and click save changes.

now, If you want to use this sidebar-left-2 on your individual post to show a different kind of ads or to elimated some widgets you only want to be seen on the home page, just go to your dashboard>appearance>editor

open up Single post (single.php) and look for this line of code
how-to-add-an-additional-left-and-right-sidebar-on-wordpress-photo-4
and just change it to
how-to-add-an-additional-left-and-right-sidebar-on-wordpress-photo-5
(same process for archives.php , index.php, search.php etc.)

update file then check, if it works.

Get the latest updates delivered straight into your Email:

 

) Your Reply...

 

Video Games - Top Blogs Philippines Computer and Video Game Blogs - Blog Catalog Blog Directory Video Games Business Directory - BTS Local Blog Directory & Search engine blogarama - the blog directory Directory of Gaming Blogs

Advertisements