<?php
/**
 * Displays footer sidebars.
 */

$has_footer_sidebar_1 = is_active_sidebar( 'footer-sidebar-1' );
$has_footer_sidebar_2 = is_active_sidebar( 'footer-sidebar-2' );
$has_footer_sidebar_3 = is_active_sidebar( 'footer-sidebar-3' );
$has_footer_sidebar_4 = is_active_sidebar( 'footer-sidebar-4' );

if ( $has_footer_sidebar_1 || $has_footer_sidebar_2 || $has_footer_sidebar_3 || $has_footer_sidebar_4 ) {
    ?>

    <aside class="footer-widgets-area uk-section uk-section-large" role="complementary" data-uk-scrollspy="cls: uk-animation-fade" style="visibility: hidden;">
        <div class="uk-container uk-container-large">
            <div class="uk-grid uk-grid-large uk-child-width-1-2@s uk-child-width-1-4@l" data-uk-grid="masonry: true;">

                <?php if ( $has_footer_sidebar_1 ) { ?>

    				<div class="footer-widgets">
    					<?php dynamic_sidebar( 'footer-sidebar-1' ); ?>
    				</div>

    			<?php } ?>

                <?php if ( $has_footer_sidebar_2 ) { ?>

    				<div class="footer-widgets">
    					<?php dynamic_sidebar( 'footer-sidebar-2' ); ?>
    				</div>

    			<?php } ?>

                <?php if ( $has_footer_sidebar_3 ) { ?>

    				<div class="footer-widgets">
    					<?php dynamic_sidebar( 'footer-sidebar-3' ); ?>
    				</div>

    			<?php } ?>

                <?php if ( $has_footer_sidebar_4 ) { ?>

    				<div class="footer-widgets">
    					<?php dynamic_sidebar( 'footer-sidebar-4' ); ?>
    				</div>

    			<?php } ?>

            </div>
        </div>
    </aside> <!-- .footer-widgets-area -->

    <?php
}
