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

$footer_text = get_cu('footer_text');
$show_widgets = get_cu('footer_widgets', true);
$footer_icp = get_cu('footer_icp');
?>

</div>
<!-- #app-warp -->
</div>
<!-- .app_container -->

	<footer id="colophon" class="site-footer pix-content">
		<?php if ($show_widgets && is_active_sidebar('footer-widget')) : ?>
		<div class="footer-widget-area">
			<?php dynamic_sidebar('footer-widget'); ?>
		</div>
		<?php endif; ?>
		<div class="site-info">
			<div class="footer-copyright">
				<?php if ($footer_text) : ?>
					<?php echo do_shortcode(wp_kses_post($footer_text)); ?>
				<?php else : ?>
					<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'pix' ) ); ?>">
						<?php printf( esc_html__( 'Proudly powered by %s', 'pix' ), 'WordPress' ); ?>
					</a>
					<span class="sep"> | </span>
					<?php printf( esc_html__( 'Theme: %1$s by %2$s.', 'pix' ), 'pix', '<a href="https://pix.plus">Fuzzz</a>' ); ?>
				<?php endif; ?>
			</div>
			<?php if (!empty($footer_icp['url']) || !empty($footer_icp['text'])) : ?>
			<div class="footer-icp">
				<?php if (!empty($footer_icp['url'])) : ?>
					<a href="<?php echo esc_url($footer_icp['url']); ?>" target="<?php echo esc_attr($footer_icp['target'] ?: '_blank'); ?>" rel="external nofollow">
						<?php echo esc_html($footer_icp['text']); ?>
					</a>
				<?php else : ?>
					<span><?php echo esc_html($footer_icp['text']); ?></span>
				<?php endif; ?>
			</div>
			<?php endif; ?>
		</div>
	</footer>
</div><!-- #page -->
<?php wp_footer(); ?>

</body>
</html>
