| Server IP : 104.26.3.156 / Your IP : 216.73.216.185 Web Server : nginx/1.27.1 System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 User : vinodai ( 3134) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v1396/bewellpeptide/public_html/wp-content/themes/bewell-theme/ |
Upload File : |
<?php
/**
* BeWell Theme — functions.php v2.4.0
* Pages get their content injected directly — no custom template assignment needed.
*/
if ( ! defined( 'ABSPATH' ) ) exit;
// ── 1. Theme Setup ──────────────────────────────────────────────────────────
function bewell_setup() {
load_theme_textdomain( 'bewell', get_template_directory() . '/languages' );
add_theme_support( 'block-templates' );
add_theme_support( 'block-template-parts' );
add_theme_support( 'editor-styles' );
add_editor_style( 'assets/css/bewell.css' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'align-wide' );
add_theme_support( 'custom-logo', array( 'height' => 60, 'width' => 200, 'flex-height' => true, 'flex-width' => true ) );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' ) );
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
add_action( 'after_setup_theme', 'bewell_setup' );
// ── 2. Enqueue ──────────────────────────────────────────────────────────────
function bewell_enqueue() {
wp_enqueue_style( 'bewell-fonts',
'https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&display=swap',
array(), null );
wp_enqueue_style( 'bewell-style',
get_template_directory_uri() . '/assets/css/bewell.css',
array( 'bewell-fonts' ), '2.4.0' );
wp_enqueue_script( 'bewell-js',
get_template_directory_uri() . '/assets/js/bewell.js',
array(), '2.4.0', true );
if ( class_exists( 'WooCommerce' ) ) {
wp_enqueue_script( 'wc-cart-fragments' );
}
wp_localize_script( 'bewell-js', 'bewellData', array(
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'bewell-nonce' ),
) );
}
add_action( 'wp_enqueue_scripts', 'bewell_enqueue' );
// ── 3. Page content builder ──────────────────────────────────────────────────
function bewell_get_page_content( $slug ) {
switch ( $slug ) {
case 'peptides':
return '<!-- wp:html -->
<div class="bw-page-hero" style="padding:48px 0 36px;border-bottom:1px solid #e8e4df;margin-bottom:0;">
<div class="bw-container">
<p class="bw-eyebrow bw-eyebrow--orange" style="margin-bottom:8px;">Research Compounds</p>
<h1 style="font-size:clamp(26px,4vw,42px);font-weight:700;letter-spacing:-0.03em;margin-bottom:8px;">All <em>Peptides</em></h1>
<p style="color:#666;font-size:14px;max-width:480px;">Three rigorously verified compounds. HPLC-tested purity, COA on every batch.</p>
</div>
</div>
<!-- /wp:html -->
<!-- wp:html -->
<div style="background:#f7f5f2;border-bottom:1px solid #e8e4df;padding:12px 0;">
<div class="bw-container" style="display:flex;gap:8px;flex-wrap:wrap;">
<span class="bw-chip">HPLC Purity ≥99%</span>
<span class="bw-chip">Mass Spec ID</span>
<span class="bw-chip">Endotoxin Screen</span>
<span class="bw-chip">Free USA Shipping $200+</span>
</div>
</div>
<!-- /wp:html -->
<!-- wp:html -->
<div class="bw-container" style="padding-top:64px;padding-bottom:80px;">
[products limit="3" columns="3" orderby="menu_order" order="ASC"]
</div>
<!-- /wp:html -->';
case 'lab-reports':
return '<!-- wp:html -->
<div class="bw-page-hero" style="padding:48px 0 36px;border-bottom:1px solid #e8e4df;">
<div class="bw-container">
<p class="bw-eyebrow bw-eyebrow--orange" style="margin-bottom:8px;">Transparency</p>
<h1 style="font-size:clamp(26px,4vw,42px);font-weight:700;letter-spacing:-0.03em;margin-bottom:8px;">Lab <em>Reports</em></h1>
<p style="color:#666;font-size:14px;max-width:520px;">Third-party HPLC purity, mass spectrometry identity, and endotoxin screening on every batch.</p>
</div>
</div>
<!-- /wp:html -->
<!-- wp:html -->
<div class="bw-container" style="padding:64px 40px 80px;">
<div style="margin-bottom:48px;border:1px solid #e8e4df;border-radius:3px;overflow:hidden;">
<div style="background:#f7f5f2;padding:20px 28px;border-bottom:1px solid #e8e4df;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;">
<div><p style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;letter-spacing:.1em;text-transform:uppercase;margin-bottom:4px;">BPC-157 — Certificate of Analysis</p><h2 style="font-size:22px;font-weight:600;margin:0;">BPC-157</h2></div>
<p style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;">Lot A1015 · Freedom Diagnostics · March 2026</p>
</div>
<div style="padding:28px;">
<p style="font-size:14px;color:#666;line-height:1.75;margin-bottom:20px;">Body Protection Compound. 15 amino acid partial sequence. Studied in gastric and musculoskeletal repair research.</p>
<table style="width:100%;border-collapse:collapse;font-size:13px;">
<tr style="background:#f7f5f2;"><th style="padding:10px 16px;text-align:left;font-family:\'DM Mono\',monospace;font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#aaa;border-bottom:1px solid #e8e4df;">Test</th><th style="padding:10px 16px;text-align:left;font-family:\'DM Mono\',monospace;font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#aaa;border-bottom:1px solid #e8e4df;">Result</th></tr>
<tr style="border-bottom:1px solid #f7f5f2;"><td style="padding:12px 16px;color:#555;">Purity (HPLC)</td><td style="padding:12px 16px;color:#1a7f3c;font-family:\'DM Mono\',monospace;font-weight:500;">99.8%</td></tr>
<tr style="border-bottom:1px solid #f7f5f2;"><td style="padding:12px 16px;color:#555;">Mass Spec</td><td style="padding:12px 16px;font-family:\'DM Mono\',monospace;">Confirmed m/z 1419.7</td></tr>
<tr><td style="padding:12px 16px;color:#555;">Endotoxin</td><td style="padding:12px 16px;color:#1a7f3c;font-family:\'DM Mono\',monospace;font-weight:500;"><1.0 EU/mg</td></tr>
</table>
</div>
</div>
<div style="margin-bottom:48px;border:1px solid #e8e4df;border-radius:3px;overflow:hidden;">
<div style="background:#f7f5f2;padding:20px 28px;border-bottom:1px solid #e8e4df;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;">
<div><p style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;letter-spacing:.1em;text-transform:uppercase;margin-bottom:4px;">GHK-Cu — Certificate of Analysis</p><h2 style="font-size:22px;font-weight:600;margin:0;">GHK-Cu</h2></div>
<p style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;">Lot A1016 · Freedom Diagnostics · March 2026</p>
</div>
<div style="padding:28px;">
<p style="font-size:14px;color:#666;line-height:1.75;margin-bottom:20px;">Copper tripeptide Gly-His-Lys chelated to copper(II). Studied in wound healing and skin biology research.</p>
<table style="width:100%;border-collapse:collapse;font-size:13px;">
<tr style="background:#f7f5f2;"><th style="padding:10px 16px;text-align:left;font-family:\'DM Mono\',monospace;font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#aaa;border-bottom:1px solid #e8e4df;">Test</th><th style="padding:10px 16px;text-align:left;font-family:\'DM Mono\',monospace;font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#aaa;border-bottom:1px solid #e8e4df;">Result</th></tr>
<tr style="border-bottom:1px solid #f7f5f2;"><td style="padding:12px 16px;color:#555;">Purity (HPLC)</td><td style="padding:12px 16px;color:#1a7f3c;font-family:\'DM Mono\',monospace;font-weight:500;">99.4%</td></tr>
<tr style="border-bottom:1px solid #f7f5f2;"><td style="padding:12px 16px;color:#555;">Mass Spec</td><td style="padding:12px 16px;font-family:\'DM Mono\',monospace;">Confirmed m/z 340.4</td></tr>
<tr><td style="padding:12px 16px;color:#555;">Endotoxin</td><td style="padding:12px 16px;color:#1a7f3c;font-family:\'DM Mono\',monospace;font-weight:500;"><1.0 EU/mg</td></tr>
</table>
</div>
</div>
<div style="border:1px solid #e8e4df;border-radius:3px;overflow:hidden;">
<div style="background:#f7f5f2;padding:20px 28px;border-bottom:1px solid #e8e4df;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;">
<div><p style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;letter-spacing:.1em;text-transform:uppercase;margin-bottom:4px;">TB-500 — Certificate of Analysis</p><h2 style="font-size:22px;font-weight:600;margin:0;">TB-500</h2></div>
<p style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;">Lot A1017 · Freedom Diagnostics · March 2026</p>
</div>
<div style="padding:28px;">
<p style="font-size:14px;color:#666;line-height:1.75;margin-bottom:20px;">Synthetic fragment of Thymosin Beta-4. Actin-binding peptide studied in tissue repair research.</p>
<table style="width:100%;border-collapse:collapse;font-size:13px;">
<tr style="background:#f7f5f2;"><th style="padding:10px 16px;text-align:left;font-family:\'DM Mono\',monospace;font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#aaa;border-bottom:1px solid #e8e4df;">Test</th><th style="padding:10px 16px;text-align:left;font-family:\'DM Mono\',monospace;font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#aaa;border-bottom:1px solid #e8e4df;">Result</th></tr>
<tr style="border-bottom:1px solid #f7f5f2;"><td style="padding:12px 16px;color:#555;">Purity (HPLC)</td><td style="padding:12px 16px;color:#1a7f3c;font-family:\'DM Mono\',monospace;font-weight:500;">99.7%</td></tr>
<tr style="border-bottom:1px solid #f7f5f2;"><td style="padding:12px 16px;color:#555;">Mass Spec</td><td style="padding:12px 16px;font-family:\'DM Mono\',monospace;">Confirmed m/z 2115.4</td></tr>
<tr><td style="padding:12px 16px;color:#555;">Endotoxin</td><td style="padding:12px 16px;color:#1a7f3c;font-family:\'DM Mono\',monospace;font-weight:500;"><0.5 EU/mg</td></tr>
</table>
</div>
</div>
</div>
<!-- /wp:html -->';
case 'partner-program':
return '<!-- wp:html -->
<div class="bw-page-hero" style="padding:48px 0 36px;border-bottom:1px solid #e8e4df;">
<div class="bw-container">
<p class="bw-eyebrow bw-eyebrow--orange" style="margin-bottom:8px;">Affiliates & Researchers</p>
<h1 style="font-size:clamp(26px,4vw,42px);font-weight:700;letter-spacing:-0.03em;margin-bottom:8px;">Partner <em>Program</em></h1>
<p style="color:#666;font-size:14px;max-width:480px;">Earn commission on every referral. Built for researchers, educators, and communities who value verified compounds.</p>
</div>
</div>
<!-- /wp:html -->
<!-- wp:html -->
<div class="bw-container" style="padding:64px 40px 80px;">
<div style="display:grid;grid-template-columns:repeat(3,1fr);gap:24px;margin-bottom:64px;">
<div style="border:1px solid #e8e4df;border-radius:3px;padding:28px;">
<div style="font-size:40px;font-weight:700;letter-spacing:-.04em;line-height:1;margin-bottom:4px;">10%</div>
<div style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;letter-spacing:.1em;text-transform:uppercase;margin-bottom:12px;">commission</div>
<h3 style="font-size:18px;font-weight:600;margin-bottom:6px;">Researcher</h3>
<div style="font-family:\'DM Mono\',monospace;font-size:12px;color:#aaa;margin-bottom:20px;">$0 to start</div>
<ul style="font-size:13px;color:#555;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:8px;">
<li>✓ Unique referral link</li><li>✓ Monthly payouts</li><li>✓ Real-time dashboard</li><li>✓ 30-day cookie window</li>
</ul>
</div>
<div style="border:1.5px solid #e8611a;border-radius:3px;padding:28px;box-shadow:0 4px 20px rgba(232,97,26,.1);">
<div style="font-size:40px;font-weight:700;letter-spacing:-.04em;line-height:1;color:#e8611a;margin-bottom:4px;">15%</div>
<div style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;letter-spacing:.1em;text-transform:uppercase;margin-bottom:12px;">commission</div>
<h3 style="font-size:18px;font-weight:600;margin-bottom:6px;">Associate <span style="background:#e8611a;color:#fff;font-size:9px;font-family:\'DM Mono\',monospace;padding:2px 8px;border-radius:2px;letter-spacing:.08em;vertical-align:middle;">MOST POPULAR</span></h3>
<div style="font-family:\'DM Mono\',monospace;font-size:12px;color:#aaa;margin-bottom:20px;">$500/mo sales</div>
<ul style="font-size:13px;color:#555;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:8px;">
<li>✓ All Researcher perks</li><li>✓ Priority support</li><li>✓ Early access to new batches</li><li>✓ Co-branded materials</li>
</ul>
</div>
<div style="border:1px solid #e8e4df;border-radius:3px;padding:28px;">
<div style="font-size:40px;font-weight:700;letter-spacing:-.04em;line-height:1;margin-bottom:4px;">20%</div>
<div style="font-family:\'DM Mono\',monospace;font-size:10px;color:#aaa;letter-spacing:.1em;text-transform:uppercase;margin-bottom:12px;">commission</div>
<h3 style="font-size:18px;font-weight:600;margin-bottom:6px;">Lab Partner</h3>
<div style="font-family:\'DM Mono\',monospace;font-size:12px;color:#aaa;margin-bottom:20px;">$2,000/mo sales</div>
<ul style="font-size:13px;color:#555;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:8px;">
<li>✓ All Associate perks</li><li>✓ Dedicated account manager</li><li>✓ Custom bulk pricing</li><li>✓ Invoice payment terms</li>
</ul>
</div>
</div>
<div style="max-width:600px;margin:0 auto;">
<h2 style="text-align:center;margin-bottom:32px;">Apply to the <em>Partner Program</em></h2>
<form class="bw-form" method="post" action="#">
<div style="display:grid;grid-template-columns:1fr 1fr;gap:16px;">
<div class="bw-form-group"><label>First Name</label><input type="text" name="first_name" required></div>
<div class="bw-form-group"><label>Last Name</label><input type="text" name="last_name" required></div>
</div>
<div class="bw-form-group"><label>Email</label><input type="email" name="email" required></div>
<div class="bw-form-group"><label>Platform / Website</label><input type="url" name="platform" placeholder="https://"></div>
<div class="bw-form-group"><label>How will you promote BeWell?</label><textarea name="message" rows="4"></textarea></div>
<button type="submit" class="bw-btn bw-btn--filled" style="width:100%;justify-content:center;">Submit Application →</button>
</form>
</div>
</div>
<!-- /wp:html -->';
case 'contact':
return '<!-- wp:html -->
<div class="bw-page-hero" style="padding:48px 0 36px;border-bottom:1px solid #e8e4df;">
<div class="bw-container">
<p class="bw-eyebrow bw-eyebrow--orange" style="margin-bottom:8px;">Get In Touch</p>
<h1 style="font-size:clamp(26px,4vw,42px);font-weight:700;letter-spacing:-0.03em;margin-bottom:8px;">Contact <em>Us</em></h1>
<p style="color:#666;font-size:14px;max-width:480px;">Questions about an order, a product, or our COA data? We respond within one business day.</p>
</div>
</div>
<!-- /wp:html -->
<!-- wp:html -->
<div class="bw-container" style="padding:64px 40px 80px;">
<div style="display:grid;grid-template-columns:1fr 1.4fr;gap:64px;align-items:start;">
<div>
<h2 style="margin-bottom:28px;">How can we <em>help?</em></h2>
<div style="display:flex;flex-direction:column;gap:24px;margin-bottom:32px;">
<div style="display:flex;gap:16px;align-items:flex-start;">
<div style="width:40px;height:40px;background:#fff3ec;border:1px solid rgba(232,97,26,.2);border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;">✉</div>
<div><div style="font-size:13px;font-weight:600;margin-bottom:4px;">Email Support</div><a href="mailto:support@bewell.com" style="font-size:14px;color:#e8611a;">support@bewell.com</a><div style="font-size:12px;color:#aaa;margin-top:2px;">Mon–Fri, 9am–6pm ET</div></div>
</div>
<div style="display:flex;gap:16px;align-items:flex-start;">
<div style="width:40px;height:40px;background:#fff3ec;border:1px solid rgba(232,97,26,.2);border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;">📦</div>
<div><div style="font-size:13px;font-weight:600;margin-bottom:4px;">Order Inquiries</div><p style="font-size:14px;color:#666;line-height:1.65;">Have your order number ready. We resolve issues within the same business day.</p></div>
</div>
</div>
<div style="padding:20px;background:#f7f5f2;border-radius:3px;border:1px solid #e8e4df;">
<div style="font-family:\'DM Mono\',monospace;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#aaa;margin-bottom:8px;">Response Times</div>
<div style="font-size:13px;color:#555;line-height:1.8;"><strong>Order issues:</strong> Same business day<br><strong>General inquiries:</strong> Within 1 business day<br><strong>Partner applications:</strong> Within 2 business days</div>
</div>
</div>
<div>
<form class="bw-form" method="post" action="#">
<div style="display:grid;grid-template-columns:1fr 1fr;gap:16px;">
<div class="bw-form-group"><label>First Name *</label><input type="text" name="first_name" required></div>
<div class="bw-form-group"><label>Last Name *</label><input type="text" name="last_name" required></div>
</div>
<div class="bw-form-group"><label>Email *</label><input type="email" name="email" required></div>
<div class="bw-form-group"><label>Subject *</label>
<select name="subject" required><option value="">Select a topic…</option><option>Order & Shipping</option><option>Product Information</option><option>Lab Report / COA</option><option>Returns & Refunds</option><option>Partner Program</option><option>Other</option></select>
</div>
<div class="bw-form-group"><label>Order Number (optional)</label><input type="text" name="order_number" placeholder="BW-XXXXXX"></div>
<div class="bw-form-group"><label>Message *</label><textarea name="message" rows="5" required></textarea></div>
<button type="submit" class="bw-btn bw-btn--filled" style="width:100%;justify-content:center;">Send Message →</button>
</form>
</div>
</div>
</div>
<!-- /wp:html -->';
default:
return '';
}
}
// ── 4. Auto-Setup ────────────────────────────────────────────────────────────
function bewell_auto_setup() {
if ( get_option( 'bewell_setup_version' ) === '2.4.0' ) return;
update_option( 'blogname', 'BeWell' );
update_option( 'blogdescription', 'Research peptides with verified purity. For laboratory use only.' );
$pages = array(
array( 'title' => 'Home', 'slug' => 'home' ),
array( 'title' => 'Peptides', 'slug' => 'peptides' ),
array( 'title' => 'Lab Reports', 'slug' => 'lab-reports' ),
array( 'title' => 'Partner Program', 'slug' => 'partner-program' ),
array( 'title' => 'Contact', 'slug' => 'contact' ),
array( 'title' => 'Privacy Policy', 'slug' => 'privacy' ),
array( 'title' => 'Terms of Service', 'slug' => 'terms' ),
array( 'title' => 'Research Use', 'slug' => 'research-use' ),
array( 'title' => 'Returns', 'slug' => 'returns' ),
array( 'title' => 'Shipping', 'slug' => 'shipping' ),
);
$home_id = 0;
foreach ( $pages as $p ) {
$content = bewell_get_page_content( $p['slug'] );
$existing = get_page_by_path( $p['slug'] );
if ( ! $existing ) {
$id = wp_insert_post( array(
'post_title' => $p['title'],
'post_name' => $p['slug'],
'post_status' => 'publish',
'post_type' => 'page',
'post_content' => $content,
'post_author' => 1,
) );
if ( ! is_wp_error( $id ) && $p['slug'] === 'home' ) $home_id = $id;
} else {
// Update content if page exists but is empty
if ( empty( trim( $existing->post_content ) ) && $content ) {
wp_update_post( array( 'ID' => $existing->ID, 'post_content' => $content ) );
}
if ( $p['slug'] === 'home' ) $home_id = $existing->ID;
}
}
if ( $home_id ) {
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $home_id );
}
// Clear default social nav posts
$old_navs = get_posts( array( 'post_type' => 'wp_navigation', 'posts_per_page' => -1, 'post_status' => 'any' ) );
foreach ( $old_navs as $nav ) {
wp_delete_post( $nav->ID, true );
}
flush_rewrite_rules();
update_option( 'bewell_setup_version', '2.4.0' );
}
add_action( 'after_switch_theme', 'bewell_auto_setup' );
add_action( 'admin_init', 'bewell_auto_setup' );
// ── 5. Age Gate ──────────────────────────────────────────────────────────────
function bewell_age_gate() {
if ( isset( $_COOKIE['bewell_age'] ) ) return;
$terms_url = esc_url( get_permalink( get_page_by_path( 'terms' ) ) ? get_permalink( get_page_by_path( 'terms' ) ) : home_url( '/terms/' ) );
$research_url = esc_url( get_permalink( get_page_by_path( 'research-use' ) ) ? get_permalink( get_page_by_path( 'research-use' ) ) : home_url( '/research-use/' ) );
?>
<div id="bw-age-gate" class="bw-age-gate" role="dialog" aria-modal="true" aria-labelledby="age-gate-title">
<div class="bw-age-gate__overlay"></div>
<div class="bw-age-gate__modal">
<div class="bw-eyebrow bw-eyebrow--orange" style="margin-bottom:10px;">Age Verification Required</div>
<h2 id="age-gate-title" class="bw-age-gate__title">You must be <span>21 or older</span> to access this site.</h2>
<p class="bw-age-gate__body">BeWell Lab sells research-grade compounds for laboratory use only. By entering you confirm you are 21+ and that all products will be used for research purposes only.</p>
<div class="bw-age-gate__actions">
<button id="bw-age-confirm" class="bw-btn bw-btn--filled" data-nonce="<?php echo esc_attr( wp_create_nonce( 'bewell-nonce' ) ); ?>">I am 21 or older — Enter</button>
<a href="https://www.google.com" class="bw-btn bw-btn--ghost">Exit</a>
</div>
<p class="bw-age-gate__legal">By entering you agree to our <a href="<?php echo $terms_url; ?>">Terms of Service</a> and <a href="<?php echo $research_url; ?>">Research Use Policy</a>.</p>
</div>
</div>
<?php
}
add_action( 'wp_body_open', 'bewell_age_gate' );
function bewell_age_confirm_handler() {
check_ajax_referer( 'bewell-nonce', 'nonce' );
setcookie( 'bewell_age', '1', time() + ( 86400 * 365 ), '/', '', is_ssl(), true );
wp_send_json_success();
}
add_action( 'wp_ajax_bewell_age_confirm', 'bewell_age_confirm_handler' );
add_action( 'wp_ajax_nopriv_bewell_age_confirm', 'bewell_age_confirm_handler' );
// ── 6. WooCommerce ────────────────────────────────────────────────────────────
add_filter( 'woocommerce_enqueue_styles', function( $s ) {
unset( $s['woocommerce-layout'], $s['woocommerce-smallscreen'] );
return $s;
} );
add_filter( 'loop_shop_per_page', function() { return 6; }, 20 );
add_filter( 'loop_shop_columns', function() { return 3; } );
// ── 7. Block styles ───────────────────────────────────────────────────────────
add_action( 'init', function() {
register_block_style( 'core/button', array( 'name' => 'bw-outline', 'label' => 'BeWell Outline' ) );
register_block_style( 'core/button', array( 'name' => 'bw-dark', 'label' => 'BeWell Dark' ) );
} );
add_filter( 'excerpt_length', function() { return 18; }, 999 );
function bewell_page_url( $slug ) {
$page = get_page_by_path( $slug );
return $page ? esc_url( get_permalink( $page->ID ) ) : esc_url( home_url( '/' . $slug . '/' ) );
}