<div class="footer-content">
<div class="container">
    <?php 
        $footer_col = '3_3_3_3';
        if( !empty( get_theme_mod( 'ft_widget_layout', '3_3_3_3' ) ) ){
            $footer_col = get_theme_mod( 'ft_widget_layout', '3_3_3_3' );
        }
        if ( is_active_sidebar( 'footer-1' ) || is_active_sidebar( 'footer-2' ) || is_active_sidebar( 'footer-3' ) || is_active_sidebar( 'footer-4' )) {
            echo '<div class="footer-widget-area">';
        }	
        
        if ( is_active_sidebar( 'footer-1' ) || is_active_sidebar( 'footer-2' ) || is_active_sidebar( 'footer-3' ) || is_active_sidebar( 'footer-4' ) ) {
            ?>
            <?php 
                if($footer_col == '3_3_3_3'){
            ?>
                <div class="row footer-widget-row">
                    <?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
                        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-3">
                            <?php dynamic_sidebar( 'footer-1' ); ?>
                        </div><!-- .widget-area -->
                    <?php endif; ?>

                    <?php if ( is_active_sidebar( 'footer-2' ) ) : ?>
                        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-3">
                            <?php dynamic_sidebar( 'footer-2' ); ?>
                        </div><!-- .widget-area -->
                    <?php endif; ?>	

                    <?php if ( is_active_sidebar( 'footer-3' ) ) : ?>
                        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-3">
                            <?php dynamic_sidebar( 'footer-3' ); ?>
                        </div><!-- .widget-area -->
                    <?php endif; ?>

                    <?php if ( is_active_sidebar( 'footer-4' ) ) : ?>
                        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-3">
                            <?php dynamic_sidebar( 'footer-4' ); ?>
                        </div><!-- .widget-area -->
                    <?php endif; ?>
                    
                </div>
            <?php }else{ ?>
                <div class="row footer-widget-row">
                    <?php
                        $footer_col = explode('_', $footer_col);
                        if( is_array($footer_col) && count($footer_col)>0 ){
                            $i = 1;
                            foreach($footer_col as $col){
                            // ROW width class
                            $row_class = 'col-xs-12 col-sm-12 col-md-6 col-lg-'.$col;
                            if ( is_active_sidebar( 'footer-'.$i.'' ) ) : ?>
                                <div class="<?php echo esc_attr($row_class); ?> footer">
                                    <?php dynamic_sidebar( 'footer-'.$i.'' ); ?>
                                </div><!-- .widget-area -->
                            <?php endif;
                            $i++;
                            }
                        }
                    ?>
                </div>
            <?php } ?>
        <?php
        }
        if ( is_active_sidebar( 'footer-1' ) || is_active_sidebar( 'footer-2' ) || is_active_sidebar( 'footer-3' ) || is_active_sidebar( 'footer-4' )) {
            echo '</div>';
        }
    ?>
</div>
</div>
<?php 
if ( has_nav_menu( 'footer' ) && true === get_theme_mod( 'enable_footer_menu', true ) ){
    $newscope_center = 'copyright-inner';
}else{
    $newscope_center = 'copyright-inner justify-content-center';
}
?>
<div class="copyright-area">
    <div class="container">
        <div class="<?php echo esc_attr( $newscope_center ); ?>">
            <div class="copyright-info">
                <div class="site-info">
                    <?php
                        $newscope_powered_by = get_theme_mod( 'powered_by', 
                            sprintf( esc_html__( ' Theme: newscope by %s', 'newscope' ), '<a target="_blank" rel="dofollow" href="'. esc_url( 'https://themeuniver.com/' ) .'">Themeuniver</a>' )
                        );
                    ?>
                    <?php echo esc_html( get_theme_mod( 'copyright_text', 'Proudly powered by WordPress |') );?> <?php echo wp_kses_post( $newscope_powered_by );?>
                </div><!-- .site-info -->
            </div>

            <?php if ( has_nav_menu( 'footer' ) && true === get_theme_mod( 'enable_footer_menu', true ) ) : ?>
                <div class="copyright-menu">
                    <?php
                        wp_nav_menu(
                            array(
                                'container' 		  => false,
                                'theme_location' 	=> 'footer',
                                'menu_id'        	=> 'footer-menu',
                                'fallback_cb'     => false,
                            )
                        );
                    ?>
                </div>
            <?php endif; ?>

        </div>
    </div>
</div>