Migrate theme templates to Bootstrap 5 components and grids

This commit is contained in:
Adolfo Reyna
2026-03-12 23:56:36 -04:00
parent 75a2173dc2
commit c2c018ff6f
7 changed files with 301 additions and 221 deletions

View File

@@ -3,81 +3,100 @@
* The front page template file.
*/
get_header();
get_header();
$hero_bg = get_theme_mod( 'hero_background_image', get_template_directory_uri() . '/assets/images/hero-default.png' );
$hero_bg = get_theme_mod('hero_background_image', get_template_directory_uri() . '/assets/images/hero-default.png');
?>
<section class="hero-section" style="background-image: url('<?php echo esc_url( $hero_bg ); ?>'); background-size: cover; background-position: center;">
<div class="hero-content">
<h1 class="hero-headline"><?php echo get_theme_mod( 'hero_headline', 'Ancient Wisdom for a Modern World.' ); ?></h1>
<p class="hero-subheadline"><?php echo get_theme_mod( 'hero_subheadline', 'A collection of biblical insights curated for the thoughtful leader.' ); ?></p>
<a href="#primary" class="cta-button"><?php echo get_theme_mod( 'hero_cta_text', 'Start Reading' ); ?></a>
<section class="hero-section text-white d-flex align-items-center position-relative"
style="background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.6)), url('<?php echo esc_url($hero_bg); ?>'); background-size: cover; background-position: center; min-height: 80vh;">
<div class="container text-center py-5">
<h1 class="display-3 fw-bold mb-4 font-serif">
<?php echo get_theme_mod('hero_headline', 'Ancient Wisdom for a Modern World.'); ?></h1>
<p class="lead fw-normal mb-5 w-75 mx-auto font-sans">
<?php echo get_theme_mod('hero_subheadline', 'A collection of biblical insights curated for the thoughtful leader.'); ?>
</p>
<a href="#primary"
class="btn btn-primary btn-lg px-5 py-3 rounded-pill text-uppercase fw-bold shadow-sm"><?php echo get_theme_mod('hero_cta_text', 'Start Reading'); ?></a>
</div>
</section>
<div class="site-container">
<div class="container my-5 py-4">
<main id="primary" class="site-main">
<header class="section-header">
<h2 class="section-title">Seek Truth. Lead with Grace.</h2>
<p class="section-subtitle">Explorations into the heart of the Kingdom.</p>
<header class="text-center mb-5">
<h2 class="display-5 fw-bold font-serif mb-3">Seek Truth. Lead with Grace.</h2>
<p class="lead text-muted font-sans font-italic">Explorations into the heart of the Kingdom.</p>
</header>
<div class="insights-grid">
<div class="row g-4 mb-5">
<?php
if ( have_posts() ) :
while ( have_posts() ) :
if (have_posts()):
while (have_posts()):
the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'insight-card' ); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<div class="col-md-6 col-lg-4 d-flex align-items-stretch">
<article id="post-<?php the_ID(); ?>" <?php post_class('card w-100 border-0 shadow-sm overflow-hidden h-100'); ?>>
<?php if (has_post_thumbnail()): ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'large' ); ?>
<?php the_post_thumbnail('large', array('class' => 'card-img-top img-fluid w-100', 'style' => 'height: 200px; object-fit: cover;')); ?>
</a>
</div>
<?php endif; ?>
<header class="entry-header">
<div class="entry-meta">
<span class="cat-links"><?php echo get_the_category_list( ', ' ); ?></span>
</div>
<?php the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); ?>
<div class="post-card-info">
<span class="post-date"><?php echo get_the_date(); ?></span>
<span class="dot-separator">•</span>
<span class="reading-time"><?php echo wisdom1_reading_time(); ?></span>
<span class="dot-separator">•</span>
<span class="comments-count"><?php comments_number( '0 comments', '1 comment', '% comments' ); ?></span>
</div>
</header>
<?php endif; ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
</article>
<div class="card-body d-flex flex-column p-4">
<header class="entry-header mb-3">
<div class="mb-2 text-uppercase small fw-bold text-muted tracking-wider">
<?php echo get_the_category_list(', '); ?>
</div>
<?php the_title('<h3 class="card-title h5 fw-bold lh-base"><a href="' . esc_url(get_permalink()) . '" class="text-dark text-decoration-none stretched-link">', '</a></h3>'); ?>
<div class="text-muted small mt-2 d-flex align-items-center flex-wrap gap-2">
<span><?php echo get_the_date(); ?></span>
<span>•</span>
<span><?php echo wisdom1_reading_time(); ?></span>
<span>•</span>
<span><?php comments_number('0 comments', '1 comment', '% comments'); ?></span>
</div>
</header>
<div class="card-text text-muted flex-grow-1">
<?php the_excerpt(); ?>
</div>
</div>
</article>
</div>
<?php
endwhile;
the_posts_navigation();
else :
echo '<p>' . esc_html__( 'No posts found.', 'wisdom1' ) . '</p>';
echo '</div>'; // close row
the_posts_navigation(array(
'screen_reader_text' => 'Posts navigation',
'prev_text' => '<span class="btn btn-outline-primary">&larr; Older Posts</span>',
'next_text' => '<span class="btn btn-outline-primary">Newer Posts &rarr;</span>',
'class' => 'd-flex justify-content-between my-5'
));
else:
echo '<div class="col-12"><div class="alert alert-info text-center">' . esc_html__('No posts found.', 'wisdom1') . '</div></div></div>';
endif;
?>
</div><!-- .insights-grid -->
</main><!-- #main -->
</div><!-- .site-container -->
</div><!-- .container -->
<section class="newsletter-strip">
<div class="newsletter-content">
<p class="newsletter-text">Receive weekly insights directly in your inbox.</p>
<form class="newsletter-form">
<input type="email" placeholder="Email address" class="newsletter-input">
<button type="submit" class="newsletter-submit">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>
</button>
<section class="bg-primary text-white py-5">
<div class="container text-center py-3">
<h3 class="h4 mb-4 font-serif">Receive weekly insights directly in your inbox.</h3>
<form class="d-flex justify-content-center mx-auto" style="max-width: 500px;">
<div class="input-group input-group-lg shadow-sm">
<input type="email" placeholder="Email address" class="form-control border-0 px-4" required>
<button type="submit" class="btn btn-dark px-4 border-0">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<line x1="5" y1="12" x2="19" y2="12"></line>
<polyline points="12 5 19 12 12 19"></polyline>
</svg>
</button>
</div>
</form>
</div>
</section>