<?php
$banner_editor_query = new WP_Query( $banner_editor_args );
if ( $banner_editor_query->have_posts() ) {
	$section_title = get_theme_mod( 'millennium_news_banner_editor_choice_title', __( 'Editor Choice', 'millennium-news' ) );
	$button_label  = get_theme_mod( 'millennium_news_banner_editor_choice_button_label', __( 'View All', 'millennium-news' ) );
	$button_link   = get_theme_mod( 'millennium_news_banner_editor_choice_button_link' );
	$button_link   = ! empty( $button_link ) ? $button_link : '#';
	?>
	<div class="editors-choice-posts">
		<?php if ( ! empty( $section_title || $button_label ) ) : ?>
			<div class="title-heading">
				<?php if ( ! empty( $section_title ) ) : ?>
					<h3 class="section-title"><?php echo esc_html( $section_title ); ?></h3>
				<?php endif; ?>
				<?php if ( ! empty( $button_label ) ) : ?>
					<a href="<?php echo esc_url( $button_link ); ?>" class="view-all"><?php echo esc_html( $button_label ); ?></a>
				<?php endif; ?>
			</div>
		<?php endif; ?>
		<div class="editor-choice-wrap">
			<?php
			while ( $banner_editor_query->have_posts() ) :
				$banner_editor_query->the_post();
				?>
				<div class="blog-post-container tile-layout">
					<div class="blog-post-inner">
						<?php if ( has_post_thumbnail() ) { ?>
							<div class="blog-post-image">
								<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
							</div>
						<?php } ?>
						<div class="blog-post-detail">
							<?php millennium_news_categories_list(); ?>
							<h2 class="entry-title">
								<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
							</h2>
							<div class="post-meta">
								<?php
								millennium_news_posted_by();
								millennium_news_posted_on();
								?>
							</div>
						</div>
					</div>
				</div>
				<?php
			endwhile;
			wp_reset_postdata();
			?>
		</div>
	</div>
	<?php
}
