<?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 Charity_Elite
 */

if ( ! is_front_page() || is_home() ) {?>
</div>
</div>
</div>
	<?php
}

$footer_bg_image = get_theme_mod( 'charity_elite_footer_bg_image', '' );
$bg_image        = '';
if ( ! empty( $footer_bg_image ) ) {
	$bg_image = 'background-image:url(' . $footer_bg_image . ');';
}
?>
<footer id="colophon" class="site-footer has-background-image" style="<?php echo esc_attr( $bg_image ); ?>">
	<div class="site-footer-top">
		<div class="ascendoor-wrapper">
			<div class="footer-widgets-wrapper">
				<?php for ( $i = 1; $i <= 4; $i++ ) { ?>
					<div class="footer-widget-single">
						<?php dynamic_sidebar( 'footer-widget-' . $i ); ?>
					</div>
				<?php } ?>
			</div>
		</div>
	</div><!-- .footer-top -->
	<div class="site-footer-middle">
		<div class="ascendoor-wrapper">
			<div class="copyright-social">
				<?php
				if ( has_nav_menu( 'social' ) ) :
					wp_nav_menu(
						array(
							'menu_class'     => 'menu social-links',
							'link_before'    => '<span class="screen-reader-text">',
							'link_after'     => '</span>',
							'theme_location' => 'social',
						)
					);
				endif;
				?>
			</div>
		</div>			
	</div>
	<div class="site-footer-bottom">
		<div class="ascendoor-wrapper">
			<div class="site-footer-bottom-wrapper">
				<div class="site-info">
					<?php
					/**
					 * Hook: charity_elite_footer_copyright.
					 *
					 * @hooked - charity_elite_output_footer_copyright_content - 10
					 */
					do_action( 'charity_elite_footer_copyright' );
					?>
				</div><!-- .site-info -->
			</div>
		</div>
	</div>
</footer><!-- #colophon -->
<?php
$is_scroll_top_active = get_theme_mod( 'charity_elite_scroll_top', true );
if ( $is_scroll_top_active ) :
	?>
	<a href="#" id="scroll-to-top" class="charity-elite-scroll-to-top"><i class="fas fa-chevron-up"></i></a>
	<?php
endif;
?>

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

<?php wp_footer(); ?>

</body>

</html>
