<?php
/**
 *
 * @package somalite
 */

//Return if the first widget area has no widgets
if ( !is_active_sidebar( 'footer-column1' ) ) {
	return;
} ?>

<?php //user selected widget columns

	$somalite_widget_num = esc_html(get_theme_mod('sm_footer_widgets', '4'));

	$somalite_col1 = '';
	$somalite_col2 = '';
	$somalite_col3 = '';
	$somalite_col4 = '';

	if ($somalite_widget_num == '4') :
		$somalite_col1 = 'col-md-3';
		$somalite_col2 = 'col-md-3';
		$somalite_col3 = 'col-md-3';
		$somalite_col4 = 'col-md-3';
	elseif ($somalite_widget_num == '3') :
		$somalite_col1 = 'col-md-4';
		$somalite_col2 = 'col-md-4';
		$somalite_col3 = 'col-md-4';
	elseif ($somalite_widget_num == '2') :
		$somalite_col1 = 'col-md-6';
		$somalite_col2 = 'col-md-6';
	else :
		$somalite_col1 = 'col-md-12';
	endif;
?>
		
<?php 
	if ( is_active_sidebar( 'footer-column1' ) ) :
		?>
			<div class="widget-column <?php echo esc_attr($somalite_col1); ?>">
				<div class="section wow fadeInUp" data-wow-duration="1s" data-wow-delay="<?php echo 1/4; ?>s">
					<?php dynamic_sidebar( 'footer-column1'); ?>
				</div>
			</div>
		<?php
	endif;
	if ( is_active_sidebar( 'footer-column2' ) ) :
		?>
			<div class="widget-column <?php echo esc_attr($somalite_col2); ?>">
				<div class="section wow fadeInUp" data-wow-duration="1s" data-wow-delay="<?php echo 2/4; ?>s">
					<?php dynamic_sidebar( 'footer-column2'); ?>
				</div>
			</div>
		<?php
	endif;
	if ( is_active_sidebar( 'footer-column3' ) ) :
		?>
			<div class="widget-column <?php echo esc_attr($somalite_col3); ?>">
				<div class="section wow fadeInUp" data-wow-duration="1s" data-wow-delay="<?php echo 3/4; ?>s">
					<?php dynamic_sidebar( 'footer-column3'); ?>
				</div>
			</div>
		<?php
	endif;
	if ( is_active_sidebar( 'footer-column4' ) ) :
		?>
			<div class="widget-column <?php echo esc_attr($somalite_col4); ?>">
				<div class="section wow fadeInUp" data-wow-duration="1s" data-wow-delay="<?php echo 4/4; ?>s">
					<?php dynamic_sidebar( 'footer-column4'); ?>
				</div>
			</div>
		<?php
	endif;
?>