WordPress Multiple Sidebars
Seems there are a lot of complicated ways to add multiple sidebars to a wordpress theme, so here is a simpler one. Add this to your functions.php file for the theme.
add_action( 'widgets_init', 'add_sidebars' );
function add_sidebars() {
register_sidebar(
array(
'id' => 'right',
'name' => __( 'right' ),
'description' => __( 'Right Sidebar' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
)
);
register_sidebar(
array(
'id' => 'left',
'name' => __( 'left' ),
'description' => __( 'Left Sidebar' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
)
);
// add however many more are needed..
}
Then to place the sidebars in your theme just use:
<?php dynamic_sidebar( 'right' ); dynamic_sidebar( 'left' ); ?>