	<?php 	
	$postid = kk_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') ) {	

	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 bgVideo( $postid ); endif; ?>
	
	
	<?php if ( get_option('toppic_theme_content_protection') === 'true' ) : ?>
	<div class="lock-wrapper">
		<div class="lock-message">
			<div>
				<?php echo esc_html( get_option('toppic_theme_protection_message') ); ?>
			</div>
		</div>
	</div>
	<?php endif; ?>
	
<?php wp_footer(); ?>

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