<?php
$options = _WSH()->option();
$hide_footer = buildark_set( $options, 'hide_whole_footer' );
$hide_copyright = buildark_set( $options, 'hide_copyright_section' );
$copyright = buildark_set( $options, 'footer_copyright' );
$hide_social = buildark_set( $options, 'hide_social_copyright_section' );
$social_media1 = buildark_set( $options, 'social_media' );
$social_media = buildark_set( $social_media1, 'social_media' );
$go_button = buildark_set( $options, 'hide_go_to_top' );

if ( ! $hide_footer ) :
?>
<!--Main Footer-->
<div class="clearfix"></div>
<footer class="main-footer">
	<div class="auto-container">
	<!--Widgets Section-->
		<?php if ( is_active_sidebar( 'footer-sidebar' ) ) :?>
        <div class="widgets-section">
			<div class="row clearfix">

				<?php dynamic_sidebar( 'footer-sidebar' );?> 

			</div>
		</div>
        <?php endif;?>
	</div>

	<!--Footer Bottom-->
	<div class="footer-bottom">
		<div class="auto-container">
			<div class="row clearfix">
			
				<?php if ( ! $hide_copyright ) :  ?>
			
					<div class="column col-md-6 col-sm-12 col-xs-12">
						<div class="copyright"><?php echo wp_kses_post( $copyright );  ?></div>
					</div>
					
				<?php endif; ?>
				
				<!--Social Column-->
				
				<?php if ( ! $hide_social ) :  ?>
				
					<div class="social-column col-md-6 col-sm-12 col-xs-12">
						<ul class="social-icon-one">

							<?php  if ( $social_media ) :  ?>

								<?php  foreach ( $social_media as $media ) : ?>

								<?php if ( isset( $media['copy'] ) ) continue;

										$link = buildark_set( $media, 'social_link' );

										$title = buildark_set( $media, 'title' );

										$icon = buildark_set( $media, 'social_icon' );

								?>

									<li><a href="<?php echo esc_url( $link );  ?>"><span class="fa <?php echo esc_attr( $icon );  ?>"></span></a></li>

								<?php endforeach; ?>

							<?php endif; ?>						

						</ul>
					</div>
				
				<?php endif; ?>
				
			</div>
		</div>
	</div>
</footer>
<!--Main Footer-->
<?php endif; ?>
</div>
<!--End pagewrapper-->

<!--Scroll to top-->

<?php if ( ! $go_button ) :  ?>

	<div class="scroll-to-top scroll-to-target" data-target="html">
		<span class="icon fa fa-arrow-up"></span>
	</div>

<?php endif; ?>

<?php wp_footer(); ?>

</body>
</html>