Create widgets in wordpress


function rainbow_widgets_init() {
register_sidebar( array(
‘name’ => __( ‘Primary Sidebar’, ‘rainbowtheme’ ),
‘id’ => ‘sidebar-1’,
‘description’ => __( ‘Main sidebar that appears on the left.’, ‘rainbowtheme’ ),
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h1 class=”widget-title”>’,
‘after_title’ => ‘</h1>’,
) );
register_sidebar( array(
‘name’ => __( ‘Content Sidebar’, ‘rainbowtheme’ ),
‘id’ => ‘sidebar-2’,
‘description’ => __( ‘Additional sidebar that appears on the right.’, ‘rainbowtheme’ ),
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h1 class=”widget-title”>’,
‘after_title’ => ‘</h1>’,
) );
register_sidebar( array(
‘name’ => __( ‘Footer Widget Area’, ‘rainbowtheme’ ),
‘id’ => ‘sidebar-3’,
‘description’ => __( ‘Appears in the footer section of the site.’, ‘rainbowtheme’ ),
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h1 class=”widget-title”>’,
‘after_title’ => ‘</h1>’,
) );
}
add_action( ‘widgets_init’, ‘rainbow_widgets_init’ );

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s