<?php
/**
 * The footer template file
 *
 * @package WordPress
 * @subpackage Charity
 * @since Charity 1.0
 */
?>

	<?php get_template_part( 'inc/templates/call', 'out' ); ?>
	<footer class="footer">
	<?php if (is_active_sidebar( 'f1-widgets' ) || is_active_sidebar( 'f2-widgets' ) || is_active_sidebar( 'f3-widgets' ) || is_active_sidebar( 'f4-widgets' ) )  : ?>
		<?php $wpl_footer_image = ot_get_option( 'wpl_footer_image', false ); ?>
		<div class="footer-body <?php echo ( $wpl_footer_image ? 'custom-image' : '' ); ?>" <?php echo ( $wpl_footer_image ? 'style="background-image: url( ' . esc_url( $wpl_footer_image ) . ' );"' : '' ); ?>>
			<div class="grid-container">
				<div class="grid-x grid-margin-x">
					<?php if ( is_active_sidebar( 'f1-widgets' ) ) : ?>
						<div class="small-12 medium-12 large-auto cell">
							<?php dynamic_sidebar( 'f1-widgets' ); ?>
						</div><!-- /.widget-footer -->
					<?php endif; ?>

					<?php if ( is_active_sidebar( 'f2-widgets' ) ) : ?>
						<div class="small-12 medium-12 large-auto cell">
							<?php dynamic_sidebar( 'f2-widgets' ); ?>
						</div><!-- /.widget-footer -->
					<?php endif; ?>

					<?php if ( is_active_sidebar( 'f3-widgets' ) ) : ?>
						<div class="small-12 medium-12 large-auto cell">
							<?php dynamic_sidebar( 'f3-widgets' ); ?>
						</div><!-- /.widget-footer -->
					<?php endif; ?>

					<?php if ( is_active_sidebar( 'f4-widgets' ) ) : ?>
						<div class="small-12 medium-12 large-auto cell">
							<?php dynamic_sidebar( 'f4-widgets' ); ?>
						</div><!-- /.widget-footer -->
					<?php endif; ?>
				</div>
			</div><!-- /.grid-container -->
		</div><!-- /.footer-body -->
	<?php endif; ?>
		<div class="footer-bar">
			<div class="grid-container">
				<div class="grid-x grid-margin-x">
					<div class="cell small-12">
						<div class="footer-credits">
							<p>
								<?php if ( ot_get_option('wpl_copyright') ){
										echo esc_html(ot_get_option('wpl_copyright'));
									} ?>
								<?php _e('Designed by', 'charity-wpl'); ?> <a href="<?php echo esc_url('https://wplook.com/product/themes/non-profit/charity-nonprofit-wordpress-theme/?utm_source=Footer-URL&utm_medium=link&utm_campaign=Charity'); ?>" title="<?php _e('WPlook Studio', 'charity-wpl'); ?>" rel="nofollow" target="_blank"><?php _e('WPlook Studio', 'charity-wpl'); ?></a>
							</p><!-- /.copyright -->
						</div><!-- /.footer-credits -->
						<div class="footer-socials">
							<!-- Social Networking -->
							<?php $wpl_toolbar_share = ot_get_option( 'wpl_toolbar_share', array() ); ?>
							<?php if( $wpl_toolbar_share ) { ?>
								<ul>
									<?php foreach( $wpl_toolbar_share as $item ) : ?>
										<li><a target="_blank" href="<?php echo esc_url($item['wpl_share_item_url']); ?>" title="<?php echo esc_attr($item['wpl_share_item_name']); ?>"> <i class="<?php echo esc_html($item['wpl_share_item_icon']); ?>"></i></a></li>
									<?php endforeach; ?>
									<li><a href="#top-toolbar" data-smooth-scroll title="<?php _e('Top', 'charity-wpl'); ?>"><i class="fas fa-chevron-up"></i></a></li>
								</ul><!-- /.socials -->
							<?php } ?>
						</div><!-- /.footer-socials -->
					</div><!-- /.cell small-12 -->
				</div>
			</div><!-- /.grid-container -->
		</div><!-- /.footer-bar -->
	</footer><!-- /.footer -->
</div><!-- /.wrapper -->
<?php wp_footer(); ?>
</body>
</html>
