Create reusable article card component and fix archive title prefixes

This commit is contained in:
Adolfo Reyna
2026-03-13 00:32:19 -04:00
parent fb54211f34
commit 2e7276597f
5 changed files with 142 additions and 138 deletions

View File

@@ -7,7 +7,7 @@ get_header(); ?>
<div class="bg-light py-5 border-bottom mb-5">
<div class="container text-center">
<h1 class="display-5 fw-bold mb-3">Archive: <?php single_cat_title(); ?></h1>
<h1 class="display-5 fw-bold mb-3"><?php single_cat_title(); ?></h1>
<?php if (category_description()): ?>
<div class="lead text-muted mx-auto w-75"><?php echo category_description(); ?></div>
<?php endif; ?>
@@ -22,19 +22,7 @@ get_header(); ?>
while (have_posts()):
the_post();
?>
<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 h-100'); ?>>
<div class="card-body d-flex flex-column">
<header class="entry-header mb-3">
<?php the_title('<h3 class="card-title h5 fw-bold"><a href="' . esc_url(get_permalink()) . '" class="text-dark text-decoration-none stretched-link">', '</a></h3>'); ?>
</header>
<div class="card-text text-muted flex-grow-1">
<?php the_excerpt(); ?>
</div>
</div>
</article>
</div>
<?php get_template_part('template-parts/content', 'card'); ?>
<?php
endwhile;