[help] How to add an extra Sidebar in my theme using a plugin?

Status
Not open for further replies.

soum111

Banned
Banned
509
2011
68
0
is it possible to do?
If yes,then plz share the plugin name..

In my current theme,there is only 1 Sidebar(in right)...I want to add an extra sidebar in Left position.

plz help me out.

thanks in advance
 
1 comment
No need for a plugin. You can register another sidebar in your theme's functions.php file. Try this...

Add this chunk of code:

Code:
/* register sidebar widget area */
function yourtheme_widgets_init() {
    register_sidebar( array(
    'name' => __( 'Secondary Widget Area', 'yourtheme' ),
    'id' => 'secondary-widget-area',
    'description' => __( 'New secondary widget area', 'yourtheme' ),
    'before_widget' => '<ul><li id="%1$s" class="%2$s">',
    'after_widget' => '</li></ul>',
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );

}
add_action( 'widgets_init', 'yourtheme_widgets_init' );
Then stick this in sidebar.php:

Code:
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('secondary-widget-area')) : ?>
<?php endif; ?>
 
Status
Not open for further replies.
Back
Top