39 lines
2.6 KiB
PHP
39 lines
2.6 KiB
PHP
<?php if (!defined('ABSPATH')) exit; ?>
|
|
<!DOCTYPE html>
|
|
<html <?php language_attributes(); ?>>
|
|
<head>
|
|
<meta charset="<?php bloginfo('charset'); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
<body <?php body_class('font-sans antialiased text-apple-dark bg-white min-h-screen flex flex-col'); ?>>
|
|
<?php wp_body_open(); ?>
|
|
|
|
<header class="gongxue-header fixed top-0 left-0 right-0 z-50 transition-all duration-300 bg-transparent" id="site-header">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between items-center h-16">
|
|
<a href="<?php echo esc_url(home_url('/')); ?>" class="flex items-center group">
|
|
<img src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/logo.png'); ?>" alt="恭学教育Logo" class="w-8 h-8 mr-2" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
|
|
<div class="w-8 h-8 bg-apple-blue rounded-lg hidden items-center justify-center mr-2 text-white font-bold">G</div>
|
|
<span class="font-bold text-lg tracking-tight text-apple-blue">恭学教育</span>
|
|
</a>
|
|
<nav class="hidden md:flex space-x-8">
|
|
<?php foreach (gx_primary_nav_items() as $item): ?>
|
|
<a href="<?php echo esc_url($item['url']); ?>" class="text-sm font-medium <?php echo !empty($item['active']) ? 'text-apple-blue' : 'text-apple-text-gray hover:text-apple-dark'; ?>"><?php echo esc_html($item['label']); ?></a>
|
|
<?php endforeach; ?>
|
|
</nav>
|
|
<button class="mobile-menu-toggle md:hidden text-apple-dark p-2" aria-label="切换菜单">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="mobile-menu md:hidden absolute top-16 left-0 right-0 bg-white h-screen border-t border-gray-100 p-4 hidden">
|
|
<div class="flex flex-col space-y-6 mt-4">
|
|
<?php foreach (gx_primary_nav_items() as $item): ?>
|
|
<a href="<?php echo esc_url($item['url']); ?>" class="text-2xl font-semibold py-2 border-b border-gray-100 <?php echo !empty($item['active']) ? 'text-apple-blue' : 'text-apple-dark'; ?>"><?php echo esc_html($item['label']); ?></a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<main class="flex-grow">
|