<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that
* other 'pages' on your WordPress site will use a different template.
*/
get_header();
$value = get_post_meta( $post->ID, 'th_sidebar_dyn', true );
?>
<div class="blog-top">
<?php  
 $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),'size' );
 ?>
 <?php if($thumbnail_src==''){?>
 <div class="blog-image" data-center="background-position: 50% 0px;" data-top-bottom="background-position: 50% -100px;">	
 <?php } else{?>	
<div class="blog-image" data-center="background-position: 50% 0px;" data-top-bottom="background-position: 50% -100px;" style=" background-image: url(<?php echo $thumbnail_src[0]; ?>);">
<?php } ?>
<div class="full-fs-caption">
     <div class="caption-container">
      <h1 class="title overtext">
      <a href="#"><?php wp_title(''); ?></a></h1>
     </div>
</div>

</div>
</div>
<div class="clearfix"></div>
<div id="page" class="clearfix <?php echo $value; ?>">
<div class="content-wrapper">
<div class="content">
<div class="page-content">
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<div class="page-description">
 <?php the_content(); ?>
</div>
<div class="multipage-links">
		<?php
			wp_link_pages( array(
						'before'      => '<span class="meta-nav">' . __( 'Pages:', 'portfoliolite' ) . '</span>',
						'after'       => '',
						'link_before' => '<span class="active">',
						'link_after'  => '</span>',
					) );
		?>
	</div>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile;
endif;
?>
</div>
</div>   
</div> 
<?php if($value!='no-sidebar'): ?>
<div class="sidebar-wrapper">
<?php get_sidebar(); ?>
</div>
<?php endif; ?>
</div>
<?php get_footer(); ?>