<?php
$banner_editor_choice_query = new WP_Query( $banner_editor_choice_args );
if ( $banner_editor_choice_query->have_posts() ) {
	$section_title   = get_theme_mod( 'early_news_banner_editor_choice_title', __( 'Editor Choice', 'early-news' ) );
	$viewall_btn     = get_theme_mod( 'early_news_banner_editor_choice_view_all_button_label', __( 'View All', 'early-news' ) );
	$viewall_btn_url = get_theme_mod( 'early_news_banner_editor_choice_view_all_button_url', '#' );
	?>
	<div class="banner-slider-area">
		<?php if ( ! empty( $section_title || $viewall_btn ) ) : ?>
			<div class="header-title">
				<h3 class="section-title"><?php echo esc_html( $section_title ); ?></h3>
				<span class="dash"></span>
				<?php if ( ! empty( $viewall_btn ) ) : ?>
					<a href="<?php echo esc_url( $viewall_btn_url ); ?>" class="view-all"><?php echo esc_html( $viewall_btn ); ?></a>
				<?php endif; ?>
			</div>
		<?php endif; ?>
		<div class="slider-area-container">
			<?php
			while ( $banner_editor_choice_query->have_posts() ) :
				$banner_editor_choice_query->the_post();
				?>
				<div class="single-card-container list-card">
					<div class="single-card-image">
						<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
					</div>
					<div class="single-card-detail">
						<div class="card-categories">
							<?php early_news_categories_list(); ?>
						</div>
						<h3 class="card-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
						<div class="card-meta">
							<span class="post-author">
								<?php early_news_posted_by(); ?>
							</span>
							<span class="post-date">
								<?php early_news_posted_on(); ?>
							</span>
						</div>
					</div>
				</div>
				<?php
			endwhile;
			wp_reset_postdata();
			?>
		</div>
	</div>
	<?php
}
