weedops-theme/header.php
Alex 8eddfee34b Initial commit: Weedops WordPress theme
Includes front-page, strain archive/single templates, header/footer,
functions.php with custom post types, and base styles.
2026-03-23 22:54:38 +00:00

91 lines
4.3 KiB
PHP

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#1a3d2b">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php // ── Age-gate compliance notice ─────────────────────────── ?>
<div class="wo-age-notice" role="note" aria-label="<?php esc_attr_e( 'Age compliance notice', 'weedops' ); ?>">
<?php esc_html_e( '21+ only. Cannabis products are for adults. Comply with your local laws.', 'weedops' ); ?>
</div>
<?php // ── Site Header ───────────────────────────────────────── ?>
<header class="wo-header" role="banner">
<div class="wo-container">
<div class="wo-header__inner">
<?php // Logo ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="wo-logo" rel="home">
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" aria-hidden="true" focusable="false">
<path d="M14 2C8.5 2 4 6.5 4 12c0 3.5 2 6.5 5 8.5L14 26l5-5.5c3-2 5-5 5-8.5C24 6.5 19.5 2 14 2z" fill="#4a9e68"/>
<path d="M14 6c-3.3 0-6 2.7-6 6 0 2 1 3.8 2.5 4.8L14 20l3.5-3.2c1.5-1 2.5-2.8 2.5-4.8 0-3.3-2.7-6-6-6z" fill="#c8a951"/>
</svg>
Weed<span>ops</span>
</a>
<?php // Primary navigation ?>
<nav class="wo-nav" id="wo-primary-nav" role="navigation" aria-label="<?php esc_attr_e( 'Primary', 'weedops' ); ?>">
<?php
wp_nav_menu( [
'theme_location' => 'primary',
'menu_class' => '',
'container' => false,
'fallback_cb' => 'weedops_fallback_nav',
] );
?>
</nav>
<?php // Header actions ?>
<div class="wo-header__actions">
<?php if ( is_user_logged_in() ) : ?>
<a href="<?php echo esc_url( get_dashboard_url() ); ?>" class="wo-btn wo-btn--outline" style="font-size:0.82rem;padding:0.45rem 0.9rem;">
<?php esc_html_e( 'Dashboard', 'weedops' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( wp_login_url() ); ?>" class="wo-btn wo-btn--primary" style="font-size:0.82rem;padding:0.45rem 0.9rem;">
<?php esc_html_e( 'Sign In', 'weedops' ); ?>
</a>
<?php endif; ?>
</div>
<?php // Mobile hamburger ?>
<button
class="wo-nav-toggle"
aria-controls="wo-primary-nav"
aria-expanded="false"
aria-label="<?php esc_attr_e( 'Toggle navigation', 'weedops' ); ?>"
style="display:none;background:none;border:none;cursor:pointer;padding:0.5rem;"
>
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" aria-hidden="true">
<rect y="3" width="22" height="2.5" rx="1.25" fill="#fff"/>
<rect y="10" width="22" height="2.5" rx="1.25" fill="#fff"/>
<rect y="17" width="22" height="2.5" rx="1.25" fill="#fff"/>
</svg>
</button>
</div><!-- .wo-header__inner -->
</div><!-- .wo-container -->
</header>
<?php
// Fallback nav when no menu is assigned
function weedops_fallback_nav(): void {
echo '<ul>';
echo '<li><a href="' . esc_url( home_url( '/' ) ) . '">' . esc_html__( 'Home', 'weedops' ) . '</a></li>';
echo '<li><a href="' . esc_url( home_url( '/strains' ) ) . '">' . esc_html__( 'Strains', 'weedops' ) . '</a></li>';
echo '<li><a href="' . esc_url( home_url( '/products' ) ) . '">' . esc_html__( 'Products', 'weedops' ) . '</a></li>';
echo '<li><a href="' . esc_url( home_url( '/dispensaries' ) ) . '">' . esc_html__( 'Dispensaries', 'weedops' ) . '</a></li>';
echo '</ul>';
}
?>
<main class="wo-main" id="main-content" role="main">
<div class="wo-container">