<?php

get_header();

global $post, $elonissa_fn_option;
$elonissa_fn_pagestyle = 'ws';

if(function_exists('rwmb_meta')){
	$elonissa_fn_pagestyle 		= get_post_meta(get_the_ID(),'elonissa_fn_page_style', true);
}
if($elonissa_fn_pagestyle == 'ws' && !elonissa_fn_if_has_sidebar()){
	$elonissa_fn_pagestyle		= 'full';
}

if($elonissa_fn_pagestyle == 'ws' && !elonissa_fn_if_has_sidebar()){
	$elonissa_fn_pagestyle		= 'full';
}

// CHeck if page is password protected	
if(post_password_required($post)){
	$protected = elonissa_fn_protectedpage();
	echo wp_kses($protected, 'post');
}
else
{

?>
<div class="elonissa_fn_single_template">

	<?php if($elonissa_fn_pagestyle == 'full'){ ?>

	<!-- WITHOUT SIDEBAR -->
	<div class="elonissa_fn_nosidebar">
		<div class="inner">
			<div class="elonissa_fn_blog_single">
				<?php get_template_part( 'template-parts/single-post-template' );?>
			</div>
		</div>
	</div>
	<!-- /WITHOUT SIDEBAR -->

	<?php }else{ ?>
	
	<div class="elonissa_fn_blog_single">
	<!-- WITH SIDEBAR -->
	<?php get_template_part( 'template-parts/single-post-template', '', array('has_sidebar' => $elonissa_fn_pagestyle) );?>
	<!-- /WITH SIDEBAR -->
	</div>
	
	<?php } ?>
				
</div>
<?php } ?>

<?php get_footer(); ?>  