<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package Invax
 */
	$invax_post_title = invax_theme_option( 'post-title' );
	$invax_post_sidebar = invax_theme_option( 'post-sidebar' );

	if( !  isset( $invax_post_title ) ){
		$invax_post_title = esc_html__( 'Blog Details', 'invax' );
		$invax_post_sidebar = "right-sidebar";

	}

	$invax_post_class = "col-md-12";
	if( !isset( $invax_post_sidebar )  && ! is_active_sidebar( 'sidebar-1' )  ){
		$invax_post_class = "col-md-12";
	}

	if( $invax_post_sidebar == "right-sidebar" ){
		$invax_post_class = "col-md-8 blog-page-right";
	}elseif( $invax_post_sidebar == "left-sidebar" ){
			$invax_post_class = "col-md-7 col-md-offset-1";
	}

get_header();
 ?>

	<div class="finance-breadcrumb-area finance-single-blog-breadcrumb" <?php if( has_post_thumbnail()):?> style="background-image:url(<?php echo esc_url(the_post_thumbnail_url('large'));?>)"<?php endif;?>>
		<div class="container">
			<div class="row">
				<div class="col-md-12">
					<?php if( !empty( $invax_post_title ) ){ ?>
					<h1><?php echo esc_html( $invax_post_title ); ?></h1>
					<?php }else{ ?>
						<h1><?php the_title(); ?></h1>
					<?php } ?>
					<a href="<?php echo esc_url( home_url('/') ); ?>"><?php esc_html_e('Home', 'invax'); ?></a>
						&nbsp; / &nbsp; 
					<span class="current"><?php the_title(); ?></span>
				</div>
			</div>
		</div>
	</div>

	<div class="finance-internal-area finance-v-composer-disabled">
		<div class="container">
			<div class="row">
				<?php  
					if( $invax_post_sidebar == 'left-sidebar' ):
						get_sidebar(); 
					endif;
				?>
				<div class="<?php echo esc_attr( $invax_post_class ); ?>">
					<?php
						while ( have_posts() ) : the_post();

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

							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.
					?>
				</div>
				<?php  
					if( $invax_post_sidebar == 'right-sidebar' ):
						get_sidebar(); 
					endif;
				?>
			</div>
		</div>
	</div>

<?php
get_footer();
