How to add widget in wordpress

go to theme directory then open function.php file then find function function twentyeleven_widgets_init()
add following code inside it:
register_sidebar( array(
‘name’ => __( ‘Main Sidebar’, ‘twentyeleven’ ),
‘id’ => ‘sidebar-1’,
‘before_widget’ => ‘

“,
‘before_title’ => ‘

‘,
‘after_title’ => ‘

‘,
) );

then call it by following code:
if(is_active_sidebar(f-1)):?>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>