<?php
/**
 * Template for displaying all single posts.
 *
 * Responsible for rendering the content of individual posts.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package Yaatra
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

get_header();

/**
 * hook - yaatra_before_page_content
 * 
 * @since 1.1.0
 */
do_action( 'yaatra_before_page_content' );
?>

<div class="cv-content-wrapper">

	<?php get_sidebar( 'left' ); ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main">

			<?php
				while ( have_posts() ) :
					the_post();

					/*
					 * Include the Post-Type-specific template for the content.
					 * If you want to override this in a child theme, then include a file
					 * called content-___.php (where ___ is the Post Type name) and that will be used instead.
					 */
					get_template_part( 'template-parts/content', 'single' );

					/**
					 * Partial template for displaying the author box.
					 * 
					 * @since 1.1.0
					 */
					get_template_part( 'template-parts/partials/single/post', 'author' );

					the_post_navigation();

					// If comments are open or we have at least one comment, load up the comment template.
					if ( comments_open() || get_comments_number() ) :
						comments_template();
					endif;

				endwhile; // End of the loop.

				/**
				 * Partial template for displaying the author box.
				 * 
				 * @since 1.1.0
				 */
				get_template_part( 'template-parts/partials/single/related', 'posts' );
			?>

		</main><!-- #main -->
	</div><!-- #primary -->

	<?php get_sidebar(); ?>
	
</div><!-- .cv-content-wrapper -->

<?php
	/**
	 * hook - yaatra_after_page_content
	 *
	 * @since 1.1.0
	 */
	do_action( 'yaatra_after_page_content' );
	
	get_footer();
