Blog

WordPress 2 Widget sidebars

by

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

10 Comments

  • Brad 2167 days ago

    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

    Reply
  • Neil 2089 days ago

    http://www.neilduckett.com

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

    Reply
  • Tom 1968 days ago

    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.

    Reply
  • vapparel 1744 days ago

    http://www.vapparel.net

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

    Reply
  • Vasiliy Nesterenko 1649 days ago

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

    Reply
  • Louis 1610 days ago

    http://www.impressivewebs.com

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

    Reply
  • Raol 1524 days ago

    http://www.pradyumasinh.com

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

    Reply
  • gaetangat 1484 days ago

    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.

    Reply
  • helpful 1468 days ago

    thank you, +1 karma for you!

    Reply
  • George 1179 days ago

    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

    Reply

Write your comment

Optional

The Bronco Family
Work With Us