Site icon Hip-Hop Website Design and Development

Downside including sidebar to Underscores theme

I’ve been battling this for hours now, any assist appreciated. I’m utilizing Underscores theme with one sidebar (sidebar-1, on the left) and Customized Sidebars plugin in order that I can have totally different aspect content material on every web page. The issue is after I add a brand new sidebar (sidebar-2) which I wish to seem simply above the footer to include the identical content material on each web page.

features.php:

perform myunderscores3_widgets_init() {
    register_sidebar( array(
        'identify'          => esc_html__( 'Sidebar', 'myunderscores3' ),
        'id'            => 'sidebar-1',
        'description'   => esc_html__( 'Add widgets right here.', 'myunderscores3' ),
        'before_widget' => '<part id="%1$s" class="widget %2$s">',
        'after_widget'  => '</part>',
        'before_title'  => '<h2 class="widget-title">',
        'after_title'   => '</h2>',
        //'before_title' => '<!--', 
        //'after_title' => '-->',       
    ) );
    register_sidebar( array(
        'identify'          => esc_html__( 'Backside Sidebar', 'myunderscores3' ),
        'id'            => 'sidebar-2',
        'description'   => esc_html__( 'Add widgets right here.', 'myunderscores3' ),
        'before_widget' => '<part id="%1$s" class="widget %2$s">',
        'after_widget'  => '</part>',
        'before_title'  => '<h2 class="widget-title">',
        'after_title'   => '</h2>',
        //'before_title' => '<!--', 
        //'after_title' => '-->',       
    ) );
}
add_action( 'widgets_init', 'myunderscores3_widgets_init' );

sidebar.php (for the sidebar-1 content material):

if ( ! is_active_sidebar( 'sidebar-1' ) ) {
    return;
}
?>

<apart id="secondary" class="widget-area">
    <?php dynamic_sidebar( 'sidebar-1' ); ?>
</apart><!-- #secondary -->

web page.php (to drag in sidebar-1):

<?php
get_sidebar();
?>
</div><!-- wrapper -->    

footer.php (to drag in sidebar-2):

if (is_active_sidebar( 'sidebar-2' )) {
      dynamic_sidebar( 'sidebar-2' );
  }
?>
    </div><!-- #content material -->

After including widget content material to sidebar-2 that is working tremendous on each web page other than the one web page that has no sidebar-1 content material. On this web page the sidebar-2 content material is showing twice – on the underside as anticipated and in sidebar-1 content material space additionally ! Moreover the ‘no-sidebar’ class is lacking from the physique. Within the backend the sidebar-1 widgets are positioned by every particular person web page whereas the sidebar-2 content material is positioned by the widget (‘As Sidebar for chosen Publish Varieties’ – Pages). On the precise web page the place the sidebar-2 content material is showing twice I’ve not specified any sidebars contained in the precise web page as I’m doing this by the widget settings. Any concepts ? Thanks