<?php 

get_header();

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

if(function_exists('rwmb_meta')){
	$elonissa_fn_pagetitle 	= get_post_meta(get_the_ID(),'elonissa_fn_page_title', true);
	$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';
}

// CHeck if page is password protected	
if(post_password_required($post)){
	$protected = elonissa_fn_protectedpage();
	echo wp_kses($protected, 'post');
}
else
{
 	$seo_page_title 			= 'h3';
	if(isset($elonissa_fn_option['seo_page_title'])){
		$seo_page_title 		= $elonissa_fn_option['seo_page_title'];
	}
	$seo_page_title__start 		= sprintf( '<%1$s class="fn__title">', $seo_page_title );
	$seo_page_title__end 		= sprintf( '</%1$s>', $seo_page_title );
?>




<div class="elonissa_fn_full_page_template">
	<?php if($elonissa_fn_pagetitle !== 'disable'){ ?>
		<!-- PAGE TITLE -->
		<div class="elonissa_fn_pagetitle">
			<div class="fn-container">
				<div class="title_holder">
					<?php elonissa_fn_breadcrumbs();?>
					<?php echo wp_kses($seo_page_title__start,'post'); the_title(); echo wp_kses($seo_page_title__end,'post'); ?>
				</div>
			</div>
		</div>
		<!-- /PAGE TITLE -->
	<?php } ?>
		
	<?php if($elonissa_fn_pagestyle == 'ws'){ ?>
	<div class="fn-container">
		<div class="elonissa_fn_hassidebar">
			<div class="elonissa_fn_leftsidebar">
		<?php } ?>

				<!-- ALL PAGES -->		
				<div class="elonissa_fn_full_page_in">

					<?php //if(isset($elonissa_fn_option)){ ?>
					<div class="fn-container">
					<?php //} ?>
						<!-- PAGE -->
						<div class="full_content elonissa_fn_page_content">
						<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

							<?php the_content(); ?>

							<?php wp_link_pages(
								array(
									'before'      => '<div class="elonissa_fn_pagelinks"><span class="title">' . esc_html__( 'Pages:', 'elonissa' ). '</span>',
									'after'       => '</div>',
									'link_before' => '<span class="number">',
									'link_after'  => '</span>',
								)); 
							?>
						</div>
						<!-- /PAGE -->

					<?php //if(!isset($elonissa_fn_option)){ ?>	
					</div>
					<?php //} ?>	

				</div>		
				<!-- /ALL PAGES -->
			<?php if($elonissa_fn_pagestyle == 'ws'){ ?>
			</div>
			<?php } ?>
			<?php if($elonissa_fn_pagestyle == 'ws'){?>
				<div class="elonissa_fn_rightsidebar">
					<?php get_sidebar(); ?>
				</div>
			</div>
		</div>
		<?php } ?>
		
		<?php if ( comments_open() || get_comments_number()){?>
		<!-- POST COMMENT -->
		<div class="elonissa_fn_comment_wrapper">
			<div class="fn-container">
				<div class="elonissa_fn_comment" id="comments">
					<div class="comment_in">
						<?php comments_template(); ?>
					</div>
				</div>
			</div>
		</div>
		<!-- /POST COMMENT -->
		<?php } ?>
		<?php endwhile; endif; ?>
</div>





<?php } ?>

<?php get_footer(); ?>  