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

?>
			</div><!-- .row -->
		</div><!-- .container -->
		<?php if ( is_front_page() || is_home() ) { 
			get_sidebar( 'home' ); 
		} ?>
	</div><!-- #content -->

	<footer id="colophon" class="site-footer" role="contentinfo">

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

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

		<div class="site-info">
			<div class="container">

				<?php
				$has_footer_nav_menu = has_nav_menu( 'footer' );
				$show_footer_social_icons = get_theme_mod( 'ruby_show_footer_social_icons', 1 );
				$col_md = ruby_get_flexible_columns( 'footer', array( $has_footer_nav_menu, $show_footer_social_icons ) );
			?>

			<?php if ( $has_footer_nav_menu || $show_footer_social_icons ) { ?>
				<nav class="footer-menu-wrapper col-md-<?php echo $col_md; ?>">
				<?php
					if ( $has_footer_nav_menu ) {
						ruby_footer_menu(); // Footer navigation
					}
				?>
				</nav><!-- .footer-menu-wrapper -->

				<div class="footer-social-icons col-md-<?php echo $col_md; ?>">
				<?php
					if ( $show_footer_social_icons ) {
						ruby_social_icons();
					}
				?>
				 </div><!-- .footer-social-icons -->
			<?php } ?>

				<div class="footer-text-wrapper">
					<span class="footer-copyright-text">
						<?php
							echo wp_kses_post( do_shortcode( get_theme_mod( 'ruby_custom_footer_text', esc_attr( get_bloginfo( 'name', 'display' ) ) . ' - &copy; ' . date( 'Y' ) . '. All Rights Reserved.&lrm;' ) ) );
						?>
					</span><!-- .footer-copyright-text -->
					<br />
					<?php ruby_footer_info(); ?>
				</div><!-- .footer-text-wrapper -->
			</div><!-- .container -->
		</div><!-- .site-info -->

		<?php ruby_scroll_to_top(); ?>

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

<?php wp_footer(); ?>

</body>
</html>