<?php get_header(); ?>
<?php $mt_sidebar_single = get_theme_mod( 'mt_sidebar_single', 'mt_sidebar_single_no'); 
   $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
<section class="topSingleBkg topPageBkg topSinglePost">
   <div class="inner-desc single-top-desc">
      <ul class="post-meta">
         <li class="meta-date"><?php echo get_the_date(get_option('date_format')); ?></li>
      </ul>
      <h1 class="post-title single-post-title"><?php the_title(); ?></h1>
   </div>
   <?php if(!empty($image)):?>
   <div class=" <?php if(!empty($image)):?> topSingleBkgImg <?php endif;?>">
      <div class="item-img" style="background-image:url('<?php echo esc_url($image[0]); ?>');"></div>
   </div>
   <?php endif;?>
</section>
<section id="wrap-content" class="blog-post-single">
   <div class="container">
   <div class="row">
      <?php if ( $mt_sidebar_single != 'mt_sidebar_single_no' ): ?>
      <div class="col-md-9 <?php if ( $mt_sidebar_single == 'mt_sidebar_single_left' ): ?> posts-holder-push-right <?php else: ?> posts-holder <?php endif; ?>">
         <?php else: ?>
         <div class="col-md-12">
            <?php endif; ?>
            <?php if ( $mt_sidebar_single == 'mt_sidebar_single_no' ): ?> 
            <div class="layout-1col-fw page-full">
               <?php endif;?>
               <?php 
                  if (have_posts()) : while (have_posts()) : the_post(); 
                  
                  $classes_post = array('blog-item-1col','single-post-holder');
                  	
                  ?>
               <article id="post-<?php the_ID(); ?>" <?php post_class($classes_post); ?> >
                  <div class="post-content single-post-content clearfix">
                     <?php the_content(); ?>
                  </div>
                  <!--post-content-->
                  <?php
                     wp_link_pages(array(
                         'before' => '<div class="page-links">',
                         'after' => '</div>',
                         'nextpagelink' => '<span class="next-page">'.esc_html__('Next Page', 'liberis').'</span>',
                         'previouspagelink' => '<span class="previous-page">'.esc_html__('Previous Page', 'liberis').'</span>',
                         'next_or_number' => 'next'
                     ));
                     ?>
                  <?php if(has_tag()): ?>
                  <div class="tags-single-page">
                     <?php the_tags('',' ', ''); ?>
                  </div>
                  <!--tags-single-page-->
                  <?php endif; ?>
                  <?php $authordesc = get_the_author_meta( 'description' );
                     if ( ! empty ( $authordesc ) ):
                     
                     ?>  
                  <div class="author-single-page clearfix">
                     <div class="author-avatar"> <?php echo get_avatar( get_the_author_meta( 'user_email' ), '100' ); ?>  </div>
                     <div class="author-content">
                        <h4><a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"> <?php the_author_meta( 'display_name' ); ?></a></h4>
                        <div class="author-text"> <?php the_author_meta( 'description' ); ?> </div>
                        <?php $twitter = get_the_author_meta('twitter');
                           $facebook = get_the_author_meta('facebook');	
                           ?>
                        <ul class="author-social">
                           <?php if (!empty($facebook) ): ?>
                           <li><a class="social-facebook" href="<?php echo esc_url($facebook); ?>" target="_blank"><i class="fab fa-facebook-f"></i></a></li>
                           <?php endif; ?>
                           <?php if (!empty($twitter) ): ?>
                           <li><a class="social-twitter" href="<?php echo esc_url($twitter); ?>" target="_blank"><i class="fab fa-twitter"></i></a></li>
                           <?php endif; ?>
                        </ul>
                     </div>
                     <!--author-content-->
                  </div>
                  <!--author-single-page-->
                  <?php endif; ?>
                  <div class="row meta-nav-holder">
                     <div class="col meta-nav">
                        <div class="nav-post"><?php previous_post_link('<h4 class="widgettitle">' . esc_html__( 'Previous post', 'liberis' ) . '</h4> %link','&larr; %title'); ?> </div>
                     </div>
                     <div class="col meta-nav meta-nav-right">
                        <div class="nav-post"><?php next_post_link('<h4 class="widgettitle">' . esc_html__( 'Next post', 'liberis' ) . '</h4> %link','%title &rarr;'); ?> </div>
                     </div>
                  </div>
                  <!--meta-nav-holder-->
               </article>
               <?php  endwhile;
                  else: ?>
               <p class="alignc"><?php esc_html_e( 'Sorry, but it seems we can&rsquo;t find what you&rsquo;re looking for. Try the menu above.', 'liberis' ); ?></p>
               <?php endif; ?>
			   
			   <?php $mt_single_related = get_theme_mod( 'mt_single_related', 'on');

		if ( $mt_single_related == 'on' )

			get_template_part('include/assets/layouts/mtsingle', 'relatedposts');
?>			   
			   
               <?php if ( comments_open() || get_comments_number() ) {	comments_template(); } ?>
            </div>
            <?php  if ( $mt_sidebar_single == 'mt_sidebar_single_no' ):  ?>
         </div>
         <?php else: ?>
         <?php get_sidebar(); ?>
         <?php endif; ?>
      </div>
      <!--row-->
   </div>
   <!--container-->
</section>
<?php get_footer(); ?>