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

[php]if (function_exists(”register_sidebar”)) {
register_sidebar(Array(”name” => “sidebar”));
register_sidebar(Array(”name” => “sponsors”));
}[/php]

Then in your template to add for column 1
[php]
< ?php if (!function_exists('dynamic_sidebar') or !dynamic_sidebar("sidebar")) { ?> etc.. < ?php } ?>
[/php]

and likewise for column 2
[php]
< ?php if (!function_exists('dynamic_sidebar') or !dynamic_sidebar("sponsors")) { ?> etc.. < ?php } ?>
[/php]

screen shoot for Admin panel on it
sidebars

DaveN

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • Live
  • StumbleUpon

3 Comments | Leave a comment »

  1. 1. Brad | July 12th 2007 @ 10:29 pm

    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

  2. 2. Neil | September 29th 2007 @ 2:01 am

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

  3. 3. Tom | January 28th 2008 @ 6:40 pm

    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.

Leave a Reply

required

required, hidden

one.com
smx

Start with £50 credit in your new Yahoo! Search Marketing account for a limited period only.

+ Advertise Here