Wordpress themes come usually with one sidebar that is widgetized so you can use all those fancy widgets. As a theme builder you have to declare those widgets to wordpress in your function.php file. The standard call, same as in the Kubrick theme look like this:
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h4>',
'after_title' => '</h4>',
'name' => 'sidebar'
));
Now on some theme you may want to register more than one sidebar. Of course you could do it with a call for each but it doesn’t sound very efficient, and it is time consuming (programmers don’t like to repeat an action, if it can be repeated it can be coded).
Thanks to the wise programmers from Automatic, there is a function to do just that: register_sidebars().
This function takes as first parameter the number of sidebar you want and as second parameter an array of parameters like the regular register_sidebar() function.
register_sidebars(5, array(
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h4>',
'after_title' => '</h4>',
'name' => 'sidebar %d'
));
This code will register 5 sidebar named sidebar 1, sidebar 2, …, sidebar 5.
Very handy when you need to register numerous sidebar with the same parameters. The down side is it makes it more difficult to know which is which in the admin
Related Items and Services:Fancy dress available here
Looking for the perfect Wedding Dress ?come to us.
We sell Mens Fancy Dress Costumes
local builders you can trust












Comments