<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Super_Blog
 */

?>
			</div><!-- .container -->
		</div><!-- .row -->
	</div><!-- #content -->

	<footer id="colophon" class="site-footer" role="contentinfo">
		
		<?php 
		$sidebar_names = array('footer-1', 'footer-2', 'footer-3', 'footer-4'  );

	    $widget_count = super_blog_widget_count( $sidebar_names ); 

	    if(0<$widget_count): ?>
		    <div class="footer-widget-wrapper">
		        <div class="container">
		            <div class="row">
			            <?php 
			            $column_class = '';

			            if( 1  === $widget_count ){
			                $column_class = 'col-md-12 col-full';
			            } elseif( 2  === $widget_count ){
			                $column_class = 'col-md-6 col-half';
			            } elseif( 3  === $widget_count ){
			                $column_class = 'col-md-4 col-three';
			            }elseif( 4  === $widget_count ){
			                $column_class = 'col-md-3 col-four';
			            } 

			            foreach ($sidebar_names as $key => $value) {

			            	if( is_active_sidebar( $value ) ){ ?>
			            		<div class="<?php echo esc_attr( $column_class ); ?>">
			            	    	<?php dynamic_sidebar( $value ); ?>
			            		</div><!-- .col -->
			            	<?php 
			        		}

			            } ?>
		            </div><!-- .row -->
		        </div><!-- .container -->
		    </div><!-- .footer-widget-wrapper -->
		<?php endif; ?>

	    <div class="site-info">
	    	<div class="container">
	    	    <div class="row">
			    	<?php 
			    	$copyright = get_theme_mod('copyright');

			    	if( !empty( $copyright )){

			    		echo esc_html( $copyright );

			    	} else{

			    		echo '&copy; '.date("Y"); 
			    		
			    	} ?> 

			    	<span class="sep"> | </span>
			    	
			    	<?php printf( esc_html__( 'Proudly powered by ', 'super-blog' ) ); ?>
			    	<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'super-blog' ) ); ?>"><?php _e('WordPress','super-blog');?></a>
			    	<span class="sep"> | </span>
			    	<?php printf( esc_html__( 'Theme: %1$s by %2$s.', 'super-blog' ), 'Super Blog', '<a href="'.esc_url( 'http://aarambhathemes.com/' ).'" rel="designer">Aarambha Themes</a>' ); ?>
		    	</div><!-- .row -->
		    </div><!-- .container -->
		</div><!-- .site-info -->
	    	
	</footer><!-- .site-footer -->

	
</div><!-- #page -->

<?php wp_footer(); ?>

</body>
</html>
