Fix products, search, and newsletter form per REPA-17

- Search: replace static <a href="/?s="> with togglable search overlay
  form that submits post_type=product for proper WooCommerce results
- Newsletter: remove mc4wp shortcode (plugin not installed), replace
  with self-contained HTML form + JS confirmation handler
- Shop by Design: link each design card to real product_tag pages
  (passive-aggressive, email-signatures, meeting-recovery, etc.)
  and show live tag.count instead of hardcoded numbers
- Category slugs: update $cat_meta mapping to match actual WC slugs
  (drinkware, wall-decor, stationery, apparel, stickers, accessories)
  in both front-page.php and archive-product.php
- Footer dept links updated to real WC category slugs

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
FrontendDev
2026-05-02 21:25:45 -04:00
parent 1cc5a8ecfe
commit de8d1b8bef
5 changed files with 126 additions and 26 deletions

View File

@@ -100,10 +100,12 @@ $shop_url = get_permalink(wc_get_page_id('shop'));
<div class="rar-cats__grid">
<?php
$cat_meta = [
'mugs' => ['DEPT. 01', 'For passive aggression at room temp.'],
'canvas' => ['DEPT. 02', 'Wall art for the soul-tired.'],
'planners' => ['DEPT. 03', 'Productivity, with a wink.'],
'apparel' => ['DEPT. 04', 'Casual Friday, but make it bitter.'],
'drinkware' => ['DEPT. 01', 'For passive aggression at room temp.'],
'wall-decor' => ['DEPT. 02', 'Wall art for the soul-tired.'],
'stationery' => ['DEPT. 03', 'Productivity, with a wink.'],
'apparel' => ['DEPT. 04', 'Casual Friday, but make it bitter.'],
'stickers' => ['DEPT. 05', 'Stick it where they'll see it.'],
'accessories' => ['DEPT. 06', 'The extras that speak for you.'],
];
if (!empty($categories)) {
@@ -236,23 +238,25 @@ $shop_url = get_permalink(wc_get_page_id('shop'));
<div class="rar-designs__grid">
<?php
$designs = [
['Per My Last Email', 'Passive Aggressive', 'paper', ['Per my', 'last email'], 8],
['Sent from my Deathbed','Email Signatures', 'ink', ['Sent from', 'my deathbed'], 6],
['The Quiet Quitter', 'Lifestyle', 'olive', ['Quietly', 'quitting'], 5],
["OOO Forever", 'Vacation Mode', 'paper', ['OOO', 'forever'], 7],
["Let's Circle Back", 'Meeting Recovery', 'ink', ['Circle', 'back ↻'], 4],
['My Plate Is Full', 'Capacity Issues', 'paper', ['My plate', 'is full.'], 5],
['Per My Last Email', 'Passive Aggressive', 'paper', ['Per my', 'last email'], 'passive-aggressive'],
['Sent from my Deathbed','Email Signatures', 'ink', ['Sent from', 'my deathbed'], 'email-signatures'],
['The Quiet Quitter', 'Lifestyle', 'olive', ['Quietly', 'quitting'], 'lifestyle'],
["OOO Forever", 'Vacation Mode', 'paper', ['OOO', 'forever'], 'vacation-mode'],
["Let's Circle Back", 'Meeting Recovery', 'ink', ['Circle', 'back ↻'], 'meeting-recovery'],
['My Plate Is Full', 'Capacity Issues', 'paper', ['My plate', 'is full.'], 'capacity-issues'],
];
$color_map = [
'paper' => ['bg' => '#FBF8EF', 'fg' => '#1A1A1A'],
'ink' => ['bg' => '#1A1A1A', 'fg' => '#F5F1E8'],
'olive' => ['bg' => '#7B8C5A', 'fg' => '#F5F1E8'],
];
foreach ($designs as [$title, $tag, $color, $lines, $count]) {
foreach ($designs as [$title, $tag, $color, $lines, $tag_slug]) {
$tag_term = get_term_by('slug', $tag_slug, 'product_tag');
$count = $tag_term ? $tag_term->count : 0;
$tag_url = $tag_term ? get_term_link($tag_term, 'product_tag') : home_url('/shop/');
$cm = $color_map[$color];
$designs_url = home_url('/designs/');
?>
<a href="<?php echo esc_url($designs_url); ?>" class="rar-card">
<a href="<?php echo esc_url($tag_url); ?>" class="rar-card">
<div class="rar-card__media" style="aspect-ratio:5/3;">
<div style="width:82%;aspect-ratio:4/2.4;background:<?php echo esc_attr($cm['bg']); ?>;border:1.5px solid var(--ink);display:flex;flex-direction:column;align-items:center;justify-content:center;color:<?php echo esc_attr($cm['fg']); ?>;font-family:var(--serif);font-style:italic;font-weight:500;font-size:20px;line-height:1.15;text-align:center;padding:10px;">
<?php foreach ($lines as $line) echo '<div>' . esc_html($line) . '</div>'; ?>