Files
repa-woocommerce/theme/archive.php
FrontendDev 1cc5a8ecfe Add RAR Storefront WordPress theme
Implements the Reply All Regrets™ frontend design: retro office aesthetic
with manila/ink/stamp-red/olive palette, Fraunces + JetBrains Mono + Inter
typography. Includes homepage, category, product detail, blog, about, cart
templates with WooCommerce integration and interactive JS (filter, sort, gallery).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 20:38:29 -04:00

70 lines
3.4 KiB
PHP

<?php
/**
* Blog index — "The Memo"
*/
get_header();
?>
<section class="rar-blog-header">
<div class="rar-form-tag" style="margin-bottom:22px;">FORM 09 · THE MEMO · WEEKLY DISPATCH</div>
<div class="rar-blog-masthead">
The Memo.<br>
<em style="color:var(--stamp);font-style:italic;">Dispatches from the chronically employed.</em>
</div>
<div class="rar-blog-subtitle">PUBLISHED WEEKLY · CIRCULATE TO YOUR DEPARTMENT · VOL. 4 · NO. <?php echo date('W'); ?></div>
</section>
<div class="rar-blog-body">
<?php if (have_posts()) : ?>
<?php
// Featured post (first one)
the_post();
$thumb = get_the_post_thumbnail_url(get_the_ID(), 'rar-hero');
$cats = get_the_category();
$cat = $cats ? $cats[0]->name : 'Feature';
$wc = max(1, ceil(str_word_count(strip_tags(get_the_content())) / 200));
?>
<a href="<?php the_permalink(); ?>" style="display:grid;grid-template-columns:1fr 1fr;gap:40px;align-items:center;margin-bottom:48px;padding-bottom:48px;border-bottom:1px solid var(--hairline-strong);cursor:pointer;color:inherit;">
<div class="rar-blog-thumb" style="aspect-ratio:16/9;">
<?php if ($thumb) : ?><img src="<?php echo esc_url($thumb); ?>" alt="<?php the_title_attribute(); ?>" /><?php endif; ?>
</div>
<div>
<div class="rar-post-meta"><?php echo esc_html(strtoupper($cat)); ?> · <?php the_date('M j'); ?> · <?php echo $wc; ?> MIN</div>
<h2 style="font-family:var(--serif);font-size:36px;font-weight:500;line-height:1.1;margin:0 0 16px;letter-spacing:-0.02em;"><?php the_title(); ?></h2>
<p style="font-size:15px;line-height:1.6;color:var(--ink-muted);margin:0 0 24px;"><?php echo wp_kses_post(wp_trim_words(get_the_excerpt(), 30)); ?></p>
<span class="rar-btn rar-btn--ghost" style="display:inline-flex;">Read dispatch →</span>
</div>
</a>
<?php if (have_posts()) : ?>
<div class="rar-blog-archive">
<?php while (have_posts()) : the_post();
$thumb2 = get_the_post_thumbnail_url(get_the_ID(), 'rar-blog-thumb');
$cats2 = get_the_category();
$cat2 = $cats2 ? $cats2[0]->name : 'Notes';
$wc2 = max(1, ceil(str_word_count(strip_tags(get_the_content())) / 200));
?>
<a href="<?php the_permalink(); ?>" class="rar-blog-card">
<div class="rar-blog-thumb">
<?php if ($thumb2) : ?><img src="<?php echo esc_url($thumb2); ?>" alt="<?php the_title_attribute(); ?>" /><?php endif; ?>
</div>
<div class="rar-post-meta"><?php echo esc_html(strtoupper($cat2)); ?> · <?php the_date('M j'); ?> · <?php echo $wc2; ?> MIN</div>
<div class="rar-post-title"><?php the_title(); ?></div>
</a>
<?php endwhile; ?>
</div>
<div style="margin-top:48px;">
<?php the_posts_pagination(['mid_size' => 2]); ?>
</div>
<?php endif; ?>
<?php else : ?>
<p style="font-family:var(--serif);font-size:24px;font-style:italic;color:var(--ink-muted);">
Nothing dispatched yet. The memo is delayed. (Again.)
</p>
<?php endif; ?>
</div>
<?php get_footer(); ?>