WordPress 2 Widget sidebars
Ok on David Naylor I hope you noticed the 2 widget sidebars, well here is the code:
in your Theme’s function.php
if (function_exists("register_sidebar")) { register_sidebar(Array("name" => "sidebar")); register_sidebar(Array("name" => "sponsors")); } |
Then in your template to add for column 1
< ?php if (!function_exists('dynamic_sidebar') or !dynamic_sidebar("sidebar")) { ?> etc.. < ?php } ?> |
and likewise for column 2
< ?php if (!function_exists('dynamic_sidebar') or !dynamic_sidebar("sponsors")) { ?> etc.. < ?php } ?> |
DaveN
10 Comments
Brad - http://www.netevolution.co.uk
Hi Dave,
Is there a wordpress plugin you used to display code in this post?, I am new to blogging but want to put code samples up in wordpress.
If you could let me know I’d be much obliged
Brad
Neil - http://www.neilduckett.com
Detailed instructions but i wasn`t able to get it to work. Any luck with the plugin Brad??
Tom
This is great, but when you say ‘Then in your template to add for column 1’, what template do you mean? Which file do you edit here?
Thanks.
vapparel - http://www.vapparel.net
I will try your widget sidebars.then i will tell you .
Vasiliy Nesterenko
Thank’s! It’s very simple, and geniously =)
Louis - http://www.impressivewebs.com
Thank you, this was helpful to add a second widget bar.
Raol - http://www.pradyumasinh.com
Thanks for the code..!
And must say really nice design.. specially the comment area..
gaetangat
Hi,
Really nice and easy solution. You make my day 🙂
Do you know if there is any possibility to add the same widget on both sidebars?
Thanks a lot.
helpful
thank you, +1 karma for you!
George
Hy. Thanks for the code.
I had some problems with the template syntax but i managed to solve it/ For others who might experience problems with the column template syntax i suggest just using the sidebar.php syntax for the dynamic_sidebar and change
|| !dynamic_sidebar( )) : ?>
|| !dynamic_sidebar(‘sponsors) ) : ?> or which ever name you chose for your sidebar