File: /home/elrashedytravel/public_html/wp-content/themes/custom-functions-1767952375/index.php
<?php
// Cache buster: 1727176800
get_header();
?>
<?php
// Display the hero section on the true homepage (either latest posts or static front page)
if ( is_home() && is_front_page() ) {
get_template_part( 'template-parts/content', 'hero' );
}
?>
<?php if ( is_home() && ! is_front_page() ) : ?>
<header class="page-header">
<div class="container">
<h1 class="page-title"><?php single_post_title(); ?></h1>
</div>
</header>
<?php endif; ?>
<div class="content-wrapper">
<main id="main" class="site-main">
<?php
if ( have_posts() ) :
echo '<div class="article-list">';
while ( have_posts() ) : the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post-card'); ?>>
<div class="post-card-image-wrapper">
<?php
$bg_style = '';
$extra_class = '';
if ( has_post_thumbnail() ) {
$bg_style = 'style="background-image: url(' . esc_url(get_the_post_thumbnail_url(null, 'large')) . ');"';
} else {
$extra_class = simple_modern_get_random_gradient_class();
}
?>
<!-- The link for the image -->
<a href="<?php the_permalink(); ?>" class="post-card-image <?php echo $extra_class; ?>" <?php echo $bg_style; ?>></a>
<!-- 頂部元信息區域 -->
<div class="post-card-meta-top">
<div class="meta-left">
<span class="meta-item meta-date"><span data-i18n="published_on"></span> <?php echo get_the_date('Y-m-d'); ?></span>
</div>
<div class="meta-right">
<?php if(function_exists('simple_modern_get_post_views')) { echo '<span class="meta-item meta-views">' . simple_modern_get_post_views(get_the_ID()) . ' <span data-i18n="views"></span></span>'; } ?>
<span class="meta-item meta-comments"><?php comments_popup_link('<span data-i18n="comment_count_0">0 </span>', '<span data-i18n="comment_count_1">1 </span>', '<span data-i18n="comment_count_n">% </span>'); ?></span>
<span class="meta-item meta-category"><?php the_category(', '); ?></span>
</div>
</div>
<!-- 底部標題區域 -->
<div class="post-card-title-overlay">
<?php the_title( sprintf( '<h2><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
</div>
</div>
<div class="post-card-content">
<div class="post-card-excerpt">
<p><?php the_excerpt(); ?></p>
</div>
</div>
</article>
<?php
endwhile;
echo '</div>'; // .article-list
the_posts_pagination( array(
'prev_text' => '<span data-i18n="previous_page"></span>',
'next_text' => '<span data-i18n="next_page"></span>',
) );
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</main><!-- #main -->
<?php get_sidebar(); ?>
</div><!-- .content-wrapper -->
<?php get_footer(); ?>