v2.1.0 — Brand token adoption + homepage verdict sections

- Remap --color-brand-primary/--color-link-hover/--focus-shadow → teal tokens
- Hero search submit → lime-500/ink (CMO brief §6)
- Hero decorative shapes → teal/lime tints
- Hero wavy underline → teal
- front-page.php: verdict taxonomy explainer (5 states) + featured verdict cards
- inc/helpers.php: new brand copy defaults (hero title + subtitle)
This commit is contained in:
peptiderepo
2026-04-26 04:22:04 +00:00
parent 614ee2a2c3
commit 4188bba014
3 changed files with 3571 additions and 3176 deletions

View File

@@ -2,21 +2,77 @@
/**
* The front page template
*
* Layout: Hero → Research Modules → PRAutoBlogger posts → Peptide News feed.
* Newsletter signup is handled by footer.php (via template part) on the front page.
* Layout: Hero → Verdict Explainer → Featured Verdict Cards → Research Modules
* → PRAutoBlogger posts → Peptide News feed.
*
* @see template-parts/module-cards.php — research modules grid
* @see template-parts/newsletter-signup.php — included via footer.php on front page
* @see functions.php — helper functions for hero content
* Brand v2.0.0: Direction C "The Trusted Guide". Hero uses the 5-state verdict
* taxonomy as the central explainer hook. Three featured verdict cards pull from
* real monographs (semaglutide / BPC-157 / Melanotan-II) via post meta.
*
* @see template-parts/module-cards.php — research modules grid
* @see template-parts/verdict/badge.php — verdict badge component
* @see template-parts/verdict/card.php — full verdict card (monograph hero)
* @see inc/helpers.php — hero title / subtitle getters
* @see assets/css/brand.css — verdict token definitions
*
* @package peptide-starter
*/
get_header();
/**
* Verdict taxonomy data for the homepage explainer strip.
* Canonical order matches CMO brief §5.1 and the 5-state enum in verdict-meta.php.
*/
$verdict_taxonomy = array(
array(
'state' => 'established',
'glyph' => '✓',
'label' => 'Established',
'description' => 'Strong RCT evidence; widely prescribed or validated.',
),
array(
'state' => 'promising',
'glyph' => '◐',
'label' => 'Promising',
'description' => 'Meaningful human data accumulating; not yet RCT-strong.',
),
array(
'state' => 'investigational',
'glyph' => '?',
'label' => 'Investigational',
'description' => 'Mechanism plausible; human trials sparse.',
),
array(
'state' => 'insufficient',
'glyph' => '⊘',
'label' => 'Insufficient Evidence',
'description' => 'Not enough data to say anything responsible.',
),
array(
'state' => 'cautionary',
'glyph' => '⚠',
'label' => 'Cautionary',
'description' => 'Active safety signals or misuse patterns.',
),
);
/**
* Featured monograph post IDs. These are the three exemplar monographs
* loaded during brand sprint v2.0.0 (2026-04-26).
* Semaglutide=211 (established), BPC-157=36 (investigational), Melanotan-II=177 (cautionary).
*/
$featured_monograph_ids = array( 211, 36, 177 );
?>
<main id="main" class="site-main">
<!-- Hero Section -->
<!-- ═══════════════════════════════════════════════════════════════
HERO SECTION
H1: customizer hero_title (default: "Is this peptide right for you?")
Sub-head: customizer hero_subtitle (default: "What the research really says")
Search: PSA plugin shortcode or fallback form; lime submit button via brand.css
═══════════════════════════════════════════════════════════════ -->
<section class="hero-section">
<div class="hero-content">
<h1 class="hero-title">
@@ -60,13 +116,149 @@ get_header();
<a href="<?php echo esc_url( home_url( '/peptides' ) ); ?>" class="ps-btn ps-btn-primary">
<?php esc_html_e( 'Browse Peptides', 'peptide-starter' ); ?>
</a>
<a href="<?php echo esc_url( home_url( '/documentation' ) ); ?>" class="ps-btn ps-btn-secondary">
<?php esc_html_e( 'Documentation', 'peptide-starter' ); ?>
<a href="<?php echo esc_url( home_url( '/how-we-review-peptides' ) ); ?>" class="ps-btn ps-btn-secondary">
<?php esc_html_e( 'Our method', 'peptide-starter' ); ?>
</a>
</div>
</div>
</section>
<!-- ═══════════════════════════════════════════════════════════════
VERDICT TAXONOMY EXPLAINER
Five verdict states shown as badge + one-line description.
Educates first-time visitors on the brand's evaluation system.
Rule: color + glyph + label always rendered together (§5.1 CMO brief).
═══════════════════════════════════════════════════════════════ -->
<section class="hero-verdict-explainer" aria-label="<?php esc_attr_e( 'Our verdict system', 'peptide-starter' ); ?>">
<div class="ps-container">
<p class="hero-verdict-explainer__heading">
<?php esc_html_e( 'Every peptide gets a verdict. Here\'s what they mean.', 'peptide-starter' ); ?>
</p>
<div class="hero-verdict-explainer__grid">
<?php foreach ( $verdict_taxonomy as $v ) : ?>
<div class="hero-verdict-explainer__item">
<span
class="pr-verdict pr-verdict--<?php echo esc_attr( $v['state'] ); ?>"
role="img"
aria-label="<?php echo esc_attr( sprintf( __( 'Verdict: %s', 'peptide-starter' ), $v['label'] ) ); ?>"
>
<span class="pr-verdict__glyph" aria-hidden="true"><?php echo esc_html( $v['glyph'] ); ?></span>
<span class="pr-verdict__label"><?php echo esc_html( $v['label'] ); ?></span>
</span>
<p class="hero-verdict-explainer__desc"><?php echo esc_html( $v['description'] ); ?></p>
</div>
<?php endforeach; ?>
</div>
<p class="hero-verdict-explainer__cta-line">
<a href="<?php echo esc_url( home_url( '/how-we-review-peptides' ) ); ?>" class="ps-btn ps-btn-tertiary ps-btn-sm">
<?php esc_html_e( 'How we assign verdicts →', 'peptide-starter' ); ?>
</a>
</p>
</div>
</section>
<!-- ═══════════════════════════════════════════════════════════════
FEATURED VERDICT CARDS
Three exemplar monographs showing the verdict card in context.
Pulls from post meta set by verdict-meta.php (verdict_state,
verdict_text, signal_row_N_label, signal_row_N_glyph).
Post IDs: semaglutide=211, BPC-157=36, Melanotan-II=177.
═══════════════════════════════════════════════════════════════ -->
<?php
$featured_posts = get_posts(
array(
'post__in' => $featured_monograph_ids,
'post_type' => 'peptide',
'posts_per_page' => 3,
'orderby' => 'post__in',
'post_status' => 'publish',
)
);
if ( ! empty( $featured_posts ) ) :
?>
<section class="hero-featured-verdicts" aria-label="<?php esc_attr_e( 'Featured peptide verdicts', 'peptide-starter' ); ?>">
<div class="ps-container">
<h2 class="hero-featured-verdicts__title"><?php esc_html_e( 'Featured verdicts', 'peptide-starter' ); ?></h2>
<p class="hero-featured-verdicts__subtitle">
<?php esc_html_e( 'Real assessments from our database — see the system in action.', 'peptide-starter' ); ?>
</p>
<div class="hero-featured-verdicts__grid">
<?php foreach ( $featured_posts as $featured_post ) :
$post_id = $featured_post->ID;
$verdict_state = get_post_meta( $post_id, 'verdict_state', true );
$verdict_text = get_post_meta( $post_id, 'verdict_text', true );
$post_url = get_permalink( $post_id );
// Verdict state config (mirrors badge.php logic).
$verdict_config = array(
'established' => array( 'glyph' => '✓', 'label' => 'Established' ),
'promising' => array( 'glyph' => '◐', 'label' => 'Promising' ),
'investigational'=> array( 'glyph' => '?', 'label' => 'Investigational' ),
'insufficient' => array( 'glyph' => '⊘', 'label' => 'Insufficient Evidence' ),
'cautionary' => array( 'glyph' => '⚠', 'label' => 'Cautionary' ),
);
$vc = isset( $verdict_config[ $verdict_state ] ) ? $verdict_config[ $verdict_state ] : null;
// Signal rows (up to 3).
$signal_rows = array();
for ( $i = 1; $i <= 3; $i++ ) {
$row_label = get_post_meta( $post_id, 'signal_row_' . $i . '_label', true );
$row_glyph = get_post_meta( $post_id, 'signal_row_' . $i . '_glyph', true );
if ( $row_label ) {
$signal_rows[] = array(
'label' => $row_label,
'glyph' => $row_glyph ? $row_glyph : '•',
);
}
}
?>
<article class="hero-verdict-card" aria-label="<?php echo esc_attr( get_the_title( $post_id ) ); ?>">
<?php if ( $vc ) : ?>
<span
class="pr-verdict pr-verdict--<?php echo esc_attr( $verdict_state ); ?> hero-verdict-card__badge"
role="img"
aria-label="<?php echo esc_attr( sprintf( __( 'Verdict: %s', 'peptide-starter' ), $vc['label'] ) ); ?>"
>
<span class="pr-verdict__glyph" aria-hidden="true"><?php echo esc_html( $vc['glyph'] ); ?></span>
<span class="pr-verdict__label"><?php echo esc_html( $vc['label'] ); ?></span>
</span>
<?php endif; ?>
<h3 class="hero-verdict-card__title">
<a href="<?php echo esc_url( $post_url ); ?>"><?php echo esc_html( get_the_title( $post_id ) ); ?></a>
</h3>
<?php if ( $verdict_text ) : ?>
<p class="hero-verdict-card__summary"><?php echo esc_html( $verdict_text ); ?></p>
<?php endif; ?>
<?php if ( ! empty( $signal_rows ) ) : ?>
<ul class="hero-verdict-card__signals" aria-label="<?php esc_attr_e( 'Evidence signals', 'peptide-starter' ); ?>">
<?php foreach ( $signal_rows as $row ) : ?>
<li class="hero-verdict-card__signal-item">
<span class="hero-verdict-card__signal-glyph" aria-hidden="true"><?php echo esc_html( $row['glyph'] ); ?></span>
<?php echo esc_html( $row['label'] ); ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<a href="<?php echo esc_url( $post_url ); ?>" class="hero-verdict-card__link">
<?php esc_html_e( 'Read the full evidence →', 'peptide-starter' ); ?>
</a>
</article>
<?php endforeach; ?>
</div>
<div class="hero-featured-verdicts__footer">
<a href="<?php echo esc_url( home_url( '/peptides' ) ); ?>" class="ps-btn ps-btn-secondary">
<?php esc_html_e( 'Browse all peptides', 'peptide-starter' ); ?>
</a>
</div>
</div>
</section>
<?php endif; ?>
<!-- Research Modules Grid (6 cards) -->
<?php get_template_part( 'template-parts/module', 'cards' ); ?>
@@ -95,6 +287,7 @@ get_header();
<?php
}
?>
</main>
<?php get_footer(); ?>

View File

@@ -155,7 +155,7 @@ function peptide_starter_the_custom_logo() {
* @return string Hero title text.
*/
function peptide_starter_get_hero_title() {
return get_theme_mod( 'hero_title', get_bloginfo( 'name' ) );
return get_theme_mod( 'hero_title', esc_html__( 'Is this peptide right for you?', 'peptide-starter' ) );
}
/**
@@ -164,7 +164,7 @@ function peptide_starter_get_hero_title() {
* @return string Hero subtitle text.
*/
function peptide_starter_get_hero_subtitle() {
return get_theme_mod( 'hero_subtitle', esc_html__( 'A scientific peptide reference database', 'peptide-starter' ) );
return get_theme_mod( 'hero_subtitle', esc_html__( 'What the research really says', 'peptide-starter' ) );
}
/**

6534
style.css

File diff suppressed because it is too large Load Diff