<?php

$blog_single_cat = meditest_get_option('blog_single_cat');
$blog_single_author = meditest_get_option('blog_single_author', false);
$blog_single_navigation = meditest_get_option('blog_nav');
$blog_single_related = meditest_get_option('blog_related', false);
$blog_single_taglist = meditest_get_option('blog_tags');
$blog_read_time = meditest_get_option('blog_read_time');

?>


<div id="main-content" class="bloglayout__One main-container blog-single post-layout-style2 single-one-bwrap single-blog-template-duo" role="main">
	<div class="container">
		<div class="row single-blog-content">

			<div class="<?php if (is_active_sidebar('sidebar-1')) {
							echo "col-lg-9";
						} else {
							echo "col-lg-12";
						} ?> col-md-12">
				<?php while (have_posts()) :
					the_post(); ?>

					<article id="post-<?php the_ID(); ?>" <?php post_class(["post-content", "post-single"]); ?>>

						<div class="blog_layout_one_Top">
							<div class="post-header-style1">
								<header class="entry-header clearfix single-blog-header">

									<?php if ($blog_single_cat == true) : ?>
										<div class="slider-category-box tab-cat-box">
											<?php require MEDITEST_THEME_DIR . '/template-parts/cat-alt-template.php'; ?>
										</div>
									<?php endif; ?>

									<h2 class="post-title single_blog_inner__Title">
										<?php the_title(); ?>
									</h2>

									<div class="post-meta-bottom-list-wrap cols-post-meta-items">
										<div class="post-meta-left-wrap cols-meta-left">
											<div class="post-meta-left-content">
												<div class="post-meta-date"> <i class="icon-calendar1"></i> <?php echo esc_html(get_the_date('F j, Y')); ?></div>
												<h4 class="post-author-name single-post-view">
													<?php echo esc_html('By ', 'meditest'); ?>
													<?php echo get_the_author_link(); ?>
												</h4>
											</div>
										</div>

										<div class="post-meta-right-wrap">
											<div class="postcomments">
												<i class="icon-message-text-11"></i>
												<?php echo esc_html('Comment: ', 'meditest') . get_comments_number(); ?>
											</div>
										</div>


									</div>


								</header>
							</div>

						</div>

						<div class="theme-blog-details">

							<?php if (has_post_thumbnail() && !post_password_required()) : ?>
								<div class="post-featured-image">
									<?php if (get_post_format() == 'video') : ?>
										<?php get_template_part('template-parts/single/post', 'video'); ?>
									<?php else : ?>
										<img class="img-fluid" src="<?php echo esc_url(get_the_post_thumbnail_url()); ?>" alt="<?php the_title_attribute(); ?>">
									<?php endif; ?>
								</div>
							<?php endif; ?>

							<div class="post-body clearfix single-blog-header single-blog-inner blog-single-block blog-details-content">
								<!-- Article content -->
								<div class="entry-content clearfix">

									<?php
									if (is_search()) {
										the_excerpt();
									} else {
										the_content();
										meditest_link_pages();
									}
									?>

									<?php if (has_tag()) :
									?>
										<div class="post-footer clearfix theme-tag-list-wrapp">
											<?php meditest_single_post_tags(); ?>
										</div>

									<?php endif;
									?>

								</div>
							</div>

						</div>

					</article>

					<?php if ($blog_single_author == true) :
					?>
						<?php meditest_theme_author_box(); ?>
					<?php endif;
					?>

					<?php if ($blog_single_navigation == true) :
					?>
						<?php meditest_theme_post_navigation(); ?>
					<?php endif;
					?>

					<?php comments_template(); ?>
				<?php endwhile; ?>
			</div>

			<?php get_sidebar(); ?>

		</div>

		<?php if ($blog_single_related == true) : ?>
			<div class="theme_related_posts_Wrapper">

				<div class="row">
					<div class="col-md-12">
						<?php get_template_part('template-parts/single/related', 'posts'); ?>
					</div>
				</div>

			</div>
		<?php endif; ?>
	</div>

</div>