<?php
/**
 * The template for displaying the footer
 * Contains the closing of the body tag and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 * @since Blogto 1.0.0
 */
?>	
</div> <!-- end content -->

		<?php 
			/**
			* Prints Instagram Slider
			* 
			* @since Blogto 1.0
			*/
			if( blogto_get_option( 'enable_instagram' ) ){
				blogto_instagram()->init();
			}
		?>
	
		<?php if( !blogto_get_option( 'disable_footer_widget') ){
			if( blogto_is_active_footer_sidebar() ):
			?>
				<section class="wrapper block-top-footer">
					<div class="container">
						<div class="row">
						<?php 
							$count = 0;
							for( $i = 1; $i <= 4; $i++ ){
								if ( is_active_sidebar( 'blogto-footer-sidebar-'.$i ) ):
								?>
									<div class="col-md-3 col-sm-6 col-xs-12">
										<?php dynamic_sidebar( 'blogto-footer-sidebar-'.$i ); ?>
									</div>
								<?php
								endif;
							}
							if( $count > 0 ){
								$return = true;
							}else{
								$return = false;
							}
						?>
						</div>
					</div>
				</section>
			<?php
			endif;	
		}
		?>
	
		<footer class="wrapper site-footer" role="contentinfo">
			<div class="container">
				<div class="footer-inner">
					<div class="row">
						<div class="col-xs-12 col-sm-6 col-md-6">
							<div class="site-info">
								<?php echo wp_kses_post( html_entity_decode( blogto_get_option( 'footer_text' ) ) ); ?>
							</div><!-- .site-info -->
						</div>
						<div class="col-xs-12 col-sm-6 col-md-6">
							<div class="footer-menu">
								<?php blogto_get_menu( 'footer' ); ?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</footer><!-- #colophon -->
		<?php wp_footer(); ?>
	
		<script>
			/**
			* Fire slider for homepage
			* @link https://owlcarousel2.github.io/OwlCarousel2/docs/started-welcome.html
			* @since Blogto 1.0.0
			*/
			function homeSlider(){
				var item_count = parseInt(jQuery( '.block-slider .slide-item').length);
				jQuery(".home-slider").owlCarousel({
					items: 1,
					autoHeight: false,
					autoHeightClass: 'name',
					animateOut: 'fadeOut',
			    	navContainer: '.block-slider .controls',
			    	dotsContainer: '#kt-slide-pager',
			    	autoplay : BLOGTO.home_slider.autoplay,
			    	autoplayTimeout : parseInt( BLOGTO.home_slider.timeout ),
			    	loop : ( item_count > 1 ) ? true : false,
			    	rtl: ( BLOGTO.is_rtl == '1' ) ? true : false,
			    	responsive:{
			    	    768:{
			    	        items: 2,
			    	        nav: true,
			    	    }
			    	},
				});
			};

			jQuery( document ).ready( function(){
				homeSlider();
			});
		</script>
	</body>
</html>