<?php
$rising_news_featured_query = new WP_Query( $rising_news_featured_news_args );
if ( $rising_news_featured_query->have_posts() ) {

	$rising_news_featured_title      = get_theme_mod( 'rising_news_featured_news_title', __( 'Featured News', 'rising-news' ) );
	$rising_news_featured_button     = get_theme_mod( 'rising_news_featured_news_button_label', __( 'View All', 'rising-news' ) );
	$rising_news_featured_button_url = get_theme_mod( 'rising_news_featured_news_button_link', '#' );
	?>
	<div class="featured-posts">
		<?php if ( ! empty( $rising_news_featured_title || $rising_news_featured_button ) ) { ?>
			<div class="title-heading">
				<?php if ( ! empty( $rising_news_featured_title ) ) : ?>
					<h3 class="section-title"><?php echo esc_html( $rising_news_featured_title ); ?></h3>
				<?php endif; ?>
				<?php if ( ! empty( $rising_news_featured_button ) ) { ?>
					<a href="<?php echo esc_url( $rising_news_featured_button_url ); ?>" class="view-all"><?php echo esc_html( $rising_news_featured_button ); ?></a>
				<?php } ?>
			</div>
		<?php } ?>
		<div class="featured-posts-wrap">
			<?php
			while ( $rising_news_featured_query->have_posts() ) :
				$rising_news_featured_query->the_post();
				?>
				<div class="blog-post-container grid-layout">
					<div class="blog-post-inner">
						<div class="blog-post-image">
							<?php if ( has_post_thumbnail() ) { ?>
								<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'post-thumbnail' ); ?></a>
							<?php } ?>
						</div>
						<div class="blog-post-detail">
							<?php rising_news_categories_list(); ?>
							<h2 class="entry-title">
								<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
							</h2>
							<div class="post-meta">
								<?php
								rising_news_posted_by();
								rising_news_posted_on();
								?>
							</div>
						</div>
					</div>
				</div>
				<?php
			endwhile;
			wp_reset_postdata();
			?>
		</div>

	</div>
	<?php
}
