//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' );
<?php if ( is_active_sidebar( 'sidebar-1' ) ) { ?> <!-- primary-sidebar --> <?php dynamic_sidebar( 'sidebar-1' ); ?> <?php } ?>