Are you the type of WordPress user who just directly download a theme and use it all the way, or the type that modified it so that it fulfills the requirement and features of your blog? It may come to you that it needs extra sidebar and you do not know how you can do that. Sometimes they only have one or two sidebar but you needed more. Read more on how you can add more sidebar.
What Do you Need
- Little knowledge on php and html. If you do not have this at least you know how to copy and paste.
- Dreamweaver for advance or notepad the least for editing files.
- A blog/ website. (Of course!)
(I assume you already know how to upload files to your web server or how to get into your local server to these theme folder)
Do These Steps
In your theme, go find a file called functions.php in your theme folder and open it. Usually if when the theme only have one sidebar, probably you will NOT find this file. Anyway, just find it or create it! (Open this file using notepad or dreamweaver).
Add copy and paste this code into that file. Then save it. (In case you create it from blank file. If its already like this just leave it.)
[sourcecode language=’php’]
[/sourcecode]
Remember the code above is to create two sidebars. You start with two because one is already define. What if you want three or four sidebars? Copy and paste this code below to the functions.php file. Then save it.
[sourcecode language=’php’]
[/sourcecode]
Next
Go find a file named sidebar.php. If you are to create two sidebar, then using notepad create a file named sidebar2.php. Paste the code below into it. Remember to put opening div and ul and closing. Then save it.
[sourcecode language=’php’]
[/sourcecode]
It will be better if you rename the sidebar.php to sidebar1.php. So as the rest of sidebars such as sidebar3.php and so on
So What Else?
Now you have more sidebars, easier to create than you can imagine. Do you know that you can put any of these sidebar to any side of your blog/ theme? Using a very simple code may enable you to do that. Put the code below to suitable places like footer or under the header. Just make sure the loop is correct. Then save it.
[sourcecode language=’php’]
[/sourcecode]
Change the sidebar number to redirect it your required. All these sidebars should appear on your widget at the admin page. Drag and drop any required widget to any of the sidebar. That’s it!
hi! i thought this tutorial was very easy and simple to follow. however, i do have a question. instead of placing the newly added sidebars to the footer or header like it was mentioned at the end of the tutorial. is there a way for me to place the newly made sidebar next to the one i currently have or as a left sidebar? any help would be appreciated. Thanks!
Yes. Absolutely you can. It is the same as adding any other extra sidebar to your footer or your existing sidebar. Means that your existing sidebar need another sidebar next to it right? All you have to do is to edit your existing sidebar width, and make the new sidebar appear on next to it. How to do this? You will need to know html and php coding the least.
Hi
This was great and very easy to follow and implement. Thanks.
Having created an extra sidebar, how do I choose which pages or posts to show that sidebar on?
Thanks
Simon
this is what i was looking for two hours. finally i have managed to create a custom sidebar just below my nav menu. thanx dude.
i cand’t find any functions.php, or sidebar.php 🙁