Introduction to Widgets
To Create a Custom WordPress Widgets you need to understand What WordPress Widgets are. Let’s find out. WordPress widgets were originally created to design the WordPress theme so users can easily maintain it from back end. The most important part of widgets is its drag & drop functionality. It makes super easy to users to simply drag & drop elements into their site. There many WordPress themes and plugins which uses WordPress widgets to allow users to create their desired layout in such a easy way. WordPress also provides some plugins to add and improve widgets functionality.
Adding custom Widget sidebar to WordPress Theme
Now add following code just after the all register_sidebar function finish.
'name' => __( 'My New Sidebar', 'twentytwelve' ),
'id' => 'sidebar-new',
'description' => __( 'This is my new sidebar', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
Then save the funciton.php file and go to wodpress admin > Appearance > Widgets. You will see our newly created sidebar will display with the Title ‘My New sidebar’.
Now you can simple drag & drop any widgets to display in this sidebar.
Display Widget area into Theme