<?php
/**
 * The footer for our theme.
 * This template is used to generate the footer for the theme.
 *
 * @package Organic Startup
 * @since Organic Startup 1.0
 */

?>

<!-- END #body -->
</main>

<!-- END #wrapper -->
</div>

<!-- BEGIN #footer -->
<footer id="footer">

	<?php if ( is_active_sidebar( 'footer' ) ) { ?>

	<!-- BEGIN .row -->
	<div class="row">

		<!-- BEGIN .content -->
		<div class="content">

			<!-- BEGIN .footer-widgets -->
			<div class="footer-widgets">

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

			<!-- END .footer-widgets -->
			</div>

		<!-- END .content -->
		</div>

	<!-- END .row -->
	</div>

	<?php } ?>

	<!-- BEGIN .row -->
	<div class="row">

		<!-- BEGIN .footer-information -->
		<div class="footer-information flex-row">

			<?php if ( has_nav_menu( 'social-menu' ) ) { ?>

			<div class="align-left">

			<?php } else { ?>

			<div class="align-center">

			<?php } ?>

				<p><?php esc_html_e( 'Copyright', 'organic-startup' ); ?> &copy; <?php echo date( esc_html__( 'Y', 'organic-startup' ) ); ?> &middot; <?php esc_html_e( 'All Rights Reserved', 'organic-startup' ); ?> &middot; <?php esc_html( bloginfo( 'name' ) ); ?></p>

				<?php if ( '' != get_theme_mod( 'organic_startup_footer_text' ) ) { ?>

					<p class="footer-site-info"><?php echo wp_kses_post( get_theme_mod( 'organic_startup_footer_text' ) ); ?></p>

				<?php } else { ?>

					<p><?php printf( esc_html__( '%1$s by %2$s', 'organic-startup' ), 'Startup Theme', '<a href="http://organicthemes.com/">Organic Themes</a>' ); ?></p>

				<?php } ?>

			</div>

			<?php if ( has_nav_menu( 'social-menu' ) ) { ?>

			<div class="align-right">

				<?php
				wp_nav_menu(
					array(
						'theme_location'  => 'social-menu',
						'title_li'        => '',
						'depth'           => 1,
						'container_class' => 'social-menu',
						'menu_class'      => 'social-icons',
						'link_before'     => '<span>',
						'link_after'      => '</span>',
					)
				);
				?>

			</div>

			<?php } ?>

		<!-- END .footer-information -->
		</div>

	<!-- END .row -->
	</div>

<!-- END #footer -->
</footer>

<?php wp_footer(); ?>

</body>
</html>
