<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package Spiral_Lite_One_Page
 */

get_header();
?>
<?php $header_image_url = get_header_image(); // Retrieve the default header image

// If the header image is not set, use a fallback
if (!$header_image_url) {
	$header_image_url = get_template_directory_uri() . '/images/bg.jpg';
	// Default image URL
} ?>
<div class="parallax-blog" data-overlay-dark="4" style="background-image: url(<?php echo esc_url($header_image_url); ?>);"> </div>
<section id="primary" class="blog section">
	<div class="container">        
            <div class="row">
                <div class="col-xl-9 col-lg-8">

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

			get_template_part( 'template-parts/content', get_post_type() );

			the_post_navigation(
				array(
					'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Previous:', 'spiral-lite-one-page' ) . '</span> <span class="nav-title">%title</span>',
					'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', 'spiral-lite-one-page' ) . '</span> <span class="nav-title">%title</span>',
				)
			);

			// 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.
		?>

</div> <!-- #end col -->
<?php wp_reset_postdata(); ?>

<div class="col-xl-3 col-lg-4"><?php get_sidebar(); ?></div>

        </div> <!-- #end row -->
    </div> <!-- #end container -->
</section><!-- #end blog -->

<?php get_footer();
