chore: import MING theme source
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
/**
|
||||
* Theme header.
|
||||
*
|
||||
* @package MING
|
||||
*/
|
||||
|
||||
?><!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(); ?>>
|
||||
<?php wp_body_open(); ?>
|
||||
|
||||
<div class="topbar">MING 明命 · 明亮生命 自然連結</div>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="header-inner">
|
||||
<button class="hamburger" type="button" aria-label="<?php esc_attr_e( '開啟選單', 'ming' ); ?>" aria-expanded="false" aria-controls="ming-mnav">
|
||||
<span></span><span></span><span></span>
|
||||
</button>
|
||||
<a class="brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="MING 首頁">
|
||||
<?php if ( has_custom_logo() ) : ?>
|
||||
<?php
|
||||
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
||||
echo wp_get_attachment_image(
|
||||
$custom_logo_id,
|
||||
'full',
|
||||
false,
|
||||
array( 'class' => 'brand-mark', 'alt' => get_bloginfo( 'name' ) )
|
||||
);
|
||||
?>
|
||||
<?php else : ?>
|
||||
<img class="brand-mark" src="<?php echo esc_url( get_template_directory_uri() . '/assets/img/logo-mark.png' ); ?>" alt="MING 標誌" width="847" height="620">
|
||||
<?php endif; ?>
|
||||
<span class="wm">MING</span>
|
||||
</a>
|
||||
<nav class="mainnav" aria-label="<?php esc_attr_e( '主選單', 'ming' ); ?>">
|
||||
<?php
|
||||
if ( has_nav_menu( 'primary' ) ) {
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'primary',
|
||||
'container' => false,
|
||||
'items_wrap' => '%3$s',
|
||||
'depth' => 1,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
echo ming_fallback_menu(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
?>
|
||||
</nav>
|
||||
<div class="header-actions">
|
||||
<?php if ( class_exists( 'WooCommerce' ) ) : ?>
|
||||
<button class="haction hsearch" type="button" aria-label="<?php esc_attr_e( '搜尋商品', 'ming' ); ?>" aria-expanded="false" aria-controls="ming-searchbar" title="<?php esc_attr_e( '搜尋商品', 'ming' ); ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
|
||||
</button>
|
||||
<a class="haction" href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" aria-label="<?php esc_attr_e( '會員中心', 'ming' ); ?>" title="<?php esc_attr_e( '會員中心', 'ming' ); ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 3.6-6.5 8-6.5s8 2.5 8 6.5"/></svg>
|
||||
</a>
|
||||
<a class="haction hcart" href="<?php echo esc_url( wc_get_cart_url() ); ?>" aria-label="<?php esc_attr_e( '購物車', 'ming' ); ?>" title="<?php esc_attr_e( '購物車', 'ming' ); ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 7h12l-1.2 12.2a1.5 1.5 0 0 1-1.5 1.3H8.7a1.5 1.5 0 0 1-1.5-1.3L6 7z"/><path d="M9 10V6a3 3 0 0 1 6 0v4"/></svg>
|
||||
<span class="hcount"><?php echo esc_html( WC()->cart->get_cart_contents_count() ); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php if ( class_exists( 'WooCommerce' ) ) : ?>
|
||||
<div class="searchbar" id="ming-searchbar" aria-hidden="true">
|
||||
<form class="searchbar-form" role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<input type="search" name="s" placeholder="<?php esc_attr_e( '搜尋商品名稱,例如:冰霸杯', 'ming' ); ?>" aria-label="<?php esc_attr_e( '搜尋商品', 'ming' ); ?>" autocomplete="off">
|
||||
<input type="hidden" name="post_type" value="product">
|
||||
<button type="submit" class="btn"><?php esc_html_e( '搜尋', 'ming' ); ?></button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="mnav-overlay" aria-hidden="true"></div>
|
||||
<div class="mnav" id="ming-mnav" aria-hidden="true">
|
||||
<div class="mnav-head">
|
||||
<button class="mnav-close" type="button" aria-label="<?php esc_attr_e( '關閉選單', 'ming' ); ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M5 5l14 14M19 5L5 19"/></svg>
|
||||
</button>
|
||||
<span class="mnav-brand">MING</span>
|
||||
</div>
|
||||
<nav class="mnav-list" aria-label="<?php esc_attr_e( '行動版選單', 'ming' ); ?>">
|
||||
<?php
|
||||
if ( has_nav_menu( 'primary' ) ) {
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'primary',
|
||||
'container' => false,
|
||||
'items_wrap' => '%3$s',
|
||||
'depth' => 1,
|
||||
'link_after' => '<span class="mnav-arrow">→</span>',
|
||||
)
|
||||
);
|
||||
} else {
|
||||
echo ming_fallback_menu(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
?>
|
||||
</nav>
|
||||
<div class="mnav-foot">
|
||||
<?php if ( class_exists( 'WooCommerce' ) ) : ?>
|
||||
<form class="mnav-search" role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<input type="search" name="s" placeholder="<?php esc_attr_e( '搜尋商品…', 'ming' ); ?>" aria-label="<?php esc_attr_e( '搜尋商品', 'ming' ); ?>">
|
||||
<input type="hidden" name="post_type" value="product">
|
||||
<button type="submit" aria-label="<?php esc_attr_e( '搜尋', 'ming' ); ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
|
||||
</button>
|
||||
</form>
|
||||
<a class="mnav-account" href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 3.6-6.5 8-6.5s8 2.5 8 6.5"/></svg>
|
||||
<?php echo is_user_logged_in() ? esc_html__( '會員中心', 'ming' ) : esc_html__( '登入 / 註冊', 'ming' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user