How to Show Multiple Sidebar Gadget on WordPress Custom Theme

Show two or more sidebar or addable place in your WordPress custom theme. Simply paste given codes on your custom theme. And make two or more sidebar place.

How to Do

  • Open functions.php file of your custom theme and paste this code.
if ( function_exists('register_sidebar') ) {

register_sidebar(
array(
'name' => esc_html__( 'sidebar-1', 'thekroyaard_spl' ),
'id' => 'tksidebar-1',
'description' => esc_html__( 'Add widgets here.', 'thekroyaard_spl' ),
'before_widget' => '<div class="sidebar_widget_1">',
'after_widget' => '</div>'
));

register_sidebar(
array(
'name' => esc_html__( 'sidebar-2', 'thekroyaard_spl' ),
'id' => 'tksidebar-2',
'description' => esc_html__( 'Add widgets here.', 'thekroyaard_spl' ),
'before_widget' => '<div class="sidebar_widget_2">',
'after_widget' => '</div>'
));
}
  • Now paste given code, where you want to show sidebar in WordPress theme.
<?php dynamic_sidebar( 'tksidebar-1' ); ?>

<?php dynamic_sidebar( 'tksidebar-2' ); ?>

Hope these code worked perfectly, Have another type of help so Contact_Us. Thank for reading this article.

FAQ

Can use this code on any WordPress theme?
Yes, use this code on your WordPress’s theme.
This code will work on Paid theme?
Yes, this code worked on Paid theme but paid theme have already two or more columns or sidebar.