<?php
$get_post_column_layout = '3';
if (is_home()) {
	$get_post_column_layout = get_theme_mod('blog_page_post_column', '1');
}elseif(is_search()){
	$get_post_column_layout = get_theme_mod('search_page_post_column', '1');
}elseif(is_archive()){
	$get_post_column_layout = get_theme_mod('archive_page_post_column', '1');
}
$post_column_layout = 'col-sm-12 col-md-6 col-lg-4';
if ( $get_post_column_layout == '1' ) {
	$post_column_layout = 'col-md-12';
} elseif ( $get_post_column_layout == '2' ) {
	$post_column_layout = 'col-lg-6 col-md-12';
} elseif ( $get_post_column_layout == '3' ) {
	$post_column_layout = 'col-sm-12 col-md-6 col-lg-4';
} elseif ( $get_post_column_layout == '4' ) {
	$post_column_layout = 'col-sm-12 col-md-6 col-lg-3';
}
$post_classes = 'book-review-blog-standard-post';
if ( ! has_post_thumbnail() ) {
	$post_classes = 'book-review-blog-standard-post no-post-thumbnail ';
}
$post_classes = apply_filters('book_review_blog_article_tag_classes', $post_classes);
$post_el_is_on = array(
	'show_post_category' => get_theme_mod('show_post_category', true),
	'show_post_thumbnail' => get_theme_mod('show_post_thumbnail', true),
	'show_post_date' => get_theme_mod('show_post_date', true),
	'show_post_author' => get_theme_mod('show_post_author', true),
	'show_post_title' => get_theme_mod('show_post_title', true),
	'show_post_excerpt' => get_theme_mod('show_post_excerpt', true),
	'show_read_more_btn' => get_theme_mod('show_post_read_more', true),
	'button_type' => get_theme_mod('read_more_button_type', true),
	'button_text' => get_theme_mod('read_more_button_text', __('Read More', 'book-review-blog')),
);
$entryContentClasses = 'book-review-blog-standard-post__entry-content text-left';
$entryContentClasses = apply_filters( 'book_review_blog_loop_entry_content_classes', $entryContentClasses );

if (!is_single()) :
?>
<div class="<?php echo esc_attr( $post_column_layout ); ?> blog-grid-layout">
<?php endif; ?>
	<article id="post-<?php the_ID(); ?>" <?php post_class( $post_classes ); ?>>
		<div class="<?php echo esc_attr($entryContentClasses);?>">
			<?php
			if ( has_post_thumbnail() ) :
				do_action( 'book_review_blog_post_loop_thumbnail_before' ); ?>
				<div class="book-review-blog-standard-post__thumbnail post-header">
					<?php
					if (true == $post_el_is_on['show_post_thumbnail']) :
						book_review_blog_post_thumbnail();
					endif;
					?>
				</div>
			<?php
			do_action( 'book_review_blog_post_loop_thumbnail_after' );
			endif;
			do_action( 'book_review_blog_post_loop_content_before' ); ?>
			<div class="book-review-blog-standard-post__content-wrapper">
				<div class="book-review-blog-standard-post__post-meta">
					<?php
					if(true == $post_el_is_on['show_post_category']) :
					?>
					<div class="book-review-blog-standard-post__post-meta mb-3">
						<?php book_review_blog_categories(); ?>
					</div>
					<?php
					endif;?>
				</div>
				<div class="book-review-blog-standard-post__post-title">
					<?php
					if(true == $post_el_is_on['show_post_title']) :?>
						<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
					<?php
					endif;
				?>
				</div>
				<?php
				if (true == $post_el_is_on['show_post_author'] || true == $post_el_is_on['show_post_date']) :
				 ?>
				<div class="book-review-blog-standard-post__blog-meta justify-content-start">
					<?php
					if (true == $post_el_is_on['show_post_author']) :
						book_review_blog_posted_by( true );
					endif;
					if(true == $post_el_is_on['show_post_date']) :
						book_review_blog_posted_on(true);
					endif;
					?>
				</div>
				<?php
				endif;
				if(true == $post_el_is_on['show_post_excerpt']) : ?>
					<div class="book-review-blog-standard-post__post-excerpt">
						<?php the_excerpt();?>
					</div>
				<?php
				endif;
				if (true == $post_el_is_on['show_read_more_btn']) :
				?>
				<div class="book-review-blog-standard-post_read-more-button<?php echo ('button' == $post_el_is_on['button_type'] ? ' button-type-button' : '');?>">
					<a href="<?php the_permalink();?>"><?php echo esc_html( $post_el_is_on['button_text'] );?></a>
				</div>
				<?php
				endif;
				?>
			</div>
			<?php do_action( 'book_review_blog_post_loop_content_after' ); ?>
		</div>
	</article>
<?php
if (!is_single()) : ?>
</div>
<?php endif; ?>