Wordpress 2 Widget sidebars

06.07.07

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 } ?>

screen shoot for Admin panel on it
sidebars

DaveN

9 Comments

  • 1

    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

    Brad
    http://www.netevolution.co.uk

    12th July 2007 @ 22:29

  • 2

    Detailed instructions but i wasn`t able to get it to work. Any luck with the plugin Brad??

    Neil
    http://www.neilduckett.com

    29th September 2007 @ 02:01

  • 3

    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.

    Tom

    28th January 2008 @ 18:40

  • 4

    I will try your widget sidebars.then i will tell you .

    vapparel
    http://www.vapparel.net

    8th September 2008 @ 09:04

  • 5

    Thank’s! It’s very simple, and geniously =)

    Vasiliy Nesterenko

    12th December 2008 @ 09:29

  • 6

    Thank you, this was helpful to add a second widget bar.

    Louis
    http://www.impressivewebs.com

    20th January 2009 @ 17:16

  • 7

    Thanks for the code..!
    And must say really nice design.. specially the comment area..

    Raol
    http://www.pradyumasinh.com

    16th April 2009 @ 12:20

  • 8

    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.

    gaetangat

    25th May 2009 @ 20:12

  • 9

    thank you, +1 karma for you!

    helpful

    10th June 2009 @ 23:59

Add a Comment

*

*

*

Come and work with David Naylor and the team Subscribe
to the David Naylor feed
Follow
David Naylor's Twitter feed
View Dave's Blog