	<?php 	
	$postid = kktfwp_postid();
	
	$bg_post_meta = get_post_meta($postid, '_custom_bg_type_value', true);
			
	if( empty( $bg_post_meta ) ) {
		$bg_post_meta = 'Default';
	}

	if ( !is_page_template('template-homepage-grid.php') && ( ( $bg_post_meta === 'Custom Slideshow' ) || ( $bg_post_meta === 'Default') ) && get_post_meta($postid, '_gallery_layout_value', true) !== 'Fullscreen' && get_post_meta( $postid, '_gallery_layout_value', true ) !== 'Fullscreen-Grid' ) {	

		kktfwp_bgSlideshow();
	
	} else if ( $bg_post_meta === 'Video' && get_post_meta( $postid, '_gallery_layout_value', true ) !== 'Fullscreen' && get_post_meta( $postid, '_gallery_layout_value', true ) !== 'Fullscreen-Grid' ) : ?>
		
		<div class="video-bg">
			<div id="player"></div>
		</div>	
		
		<?php kktfwp_bgVideo( $postid ); ?>
		
	<?php elseif ( $bg_post_meta === 'Image' ) : ?>

		<?php kktfwp_bg_image(); ?>
		
	<?php endif; ?>	
	
	<?php if ( get_theme_mod( 'kktfwp_protection', 0 ) ) : ?>
	<div class="lock-wrapper">
		<div class="lock-message">
			<div>
				<?php echo esc_html( get_theme_mod( 'kktfwp_protection_message' ) ); ?>
			</div>
		</div>
	</div>
	<?php endif; ?>
	
<?php wp_footer(); ?>

</body>
<!-- end body -->
</html>