Add a new widget position

  1. In the functions.php file add
    //add widget position
     function widget_insertion_init() {
      register_sidebar( array(
     'name' => 'widget name',
     'id' => 'sidebar_1',
     'before_widget' => '<div>',
     'after_widget' => '</div>',
     'before_title' => '<h2>',
     'after_title' => '</h2>',
     ) );
    }
    add_action('widgets_init','mailchimp_insertion_init' );
  2. Then use the following code to display the widget in a template file:
    <?php if ( is_active_sidebar( 'sidebar-1' ) ) { ?>
     <!-- primary-sidebar -->
     <?php dynamic_sidebar( 'sidebar-1' ); ?>
     <?php } ?>