162 lines
9.4 KiB
PHP
162 lines
9.4 KiB
PHP
<?php
|
|
/**
|
|
* هدر — لوگو، منوی دسکتاپ، ابزارها، دراور موبایل
|
|
*
|
|
* @package Hesabix2
|
|
*/
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html <?php language_attributes(); ?> dir="rtl" class="scroll-smooth">
|
|
<head>
|
|
<meta charset="<?php bloginfo('charset'); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
<body <?php body_class('bg-light-50 text-slate-800'); ?>>
|
|
<?php wp_body_open(); ?>
|
|
|
|
<header class="site-header-bar" id="site-header">
|
|
<div class="site-header-bar__accent" aria-hidden="true"></div>
|
|
<div class="site-header-bar__inner">
|
|
<div class="site-header-bar__row">
|
|
<?php
|
|
$custom_logo_id = get_theme_mod('custom_logo');
|
|
$site_icon_url = get_site_icon_url(96);
|
|
$brand_name = get_bloginfo('name');
|
|
$brand_logo_url = '';
|
|
if ($custom_logo_id) {
|
|
$logo_src = wp_get_attachment_image_src($custom_logo_id, 'medium');
|
|
if (!empty($logo_src[0])) {
|
|
$brand_logo_url = $logo_src[0];
|
|
}
|
|
}
|
|
?>
|
|
<a href="<?php echo esc_url(home_url('/')); ?>" class="site-brand">
|
|
<?php
|
|
if ($brand_logo_url) :
|
|
?>
|
|
<span class="site-brand__icon" aria-hidden="true">
|
|
<img src="<?php echo esc_url($brand_logo_url); ?>" alt="<?php echo esc_attr($brand_name); ?>" width="40" height="40" loading="eager" decoding="async">
|
|
</span>
|
|
<?php elseif ($site_icon_url) : ?>
|
|
<span class="site-brand__icon" aria-hidden="true">
|
|
<img src="<?php echo esc_url($site_icon_url); ?>" alt="<?php echo esc_attr($brand_name); ?>" width="40" height="40" loading="eager" decoding="async">
|
|
</span>
|
|
<?php else : ?>
|
|
<span class="site-brand__letter" aria-hidden="true"><?php echo esc_html(mb_substr(get_bloginfo('name'), 0, 1)); ?></span>
|
|
<?php endif; ?>
|
|
<span class="site-brand__name"><?php echo esc_html(get_bloginfo('name')); ?></span>
|
|
</a>
|
|
|
|
<nav class="hesabix-header-nav" aria-label="<?php esc_attr_e('منوی اصلی', 'hesabix2'); ?>">
|
|
<?php
|
|
if (function_exists('hesabix2_render_header_desktop_nav')) {
|
|
hesabix2_render_header_desktop_nav();
|
|
}
|
|
?>
|
|
</nav>
|
|
|
|
<div class="site-header-bar__end">
|
|
<?php
|
|
$hesabix_header_search_product = function_exists( 'hesabix2_wc_header_search_is_product' ) && hesabix2_wc_header_search_is_product();
|
|
$hesabix_header_search_label = function_exists( 'hesabix2_wc_header_search_aria_label' )
|
|
? hesabix2_wc_header_search_aria_label()
|
|
: __( 'جستجو در سایت', 'hesabix2' );
|
|
$hesabix_header_search_placeholder = function_exists( 'hesabix2_wc_header_search_placeholder' )
|
|
? hesabix2_wc_header_search_placeholder()
|
|
: __( 'جستجو در سایت…', 'hesabix2' );
|
|
?>
|
|
<div class="site-header-bar__desktop-tools">
|
|
<?php if (function_exists('hesabix2_wc_render_header_cart_slot')) : ?>
|
|
<?php hesabix2_wc_render_header_cart_slot('desktop'); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ( function_exists( 'hesabix2_render_header_auth_desktop' ) ) {
|
|
hesabix2_render_header_auth_desktop();
|
|
}
|
|
$hesabix_header_arc_url = function_exists( 'hesabix2_fp_arc_url' ) ? hesabix2_fp_arc_url() : '';
|
|
?>
|
|
<?php if ( $hesabix_header_arc_url ) : ?>
|
|
<a
|
|
href="<?php echo esc_url( $hesabix_header_arc_url ); ?>"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="hesabix-header-cta"
|
|
<?php echo function_exists( 'hesabix2_entry_link_attrs' ) ? hesabix2_entry_link_attrs( 'arc', $hesabix_header_arc_url ) : ''; ?>
|
|
><?php echo esc_html( function_exists( 'hesabix2_fp_cta_primary_label' ) ? hesabix2_fp_cta_primary_label() : __( 'شروع رایگان', 'hesabix2' ) ); ?></a>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="site-header-bar__mobile-tools">
|
|
<?php if (function_exists('hesabix2_wc_render_header_cart_slot')) : ?>
|
|
<?php hesabix2_wc_render_header_cart_slot('mobile-icon'); ?>
|
|
<?php endif; ?>
|
|
|
|
<button
|
|
type="button"
|
|
id="menu-toggle"
|
|
class="hesabix-header-icon-btn hesabix-header-menu-toggle"
|
|
aria-label="<?php esc_attr_e('باز و بسته کردن منو', 'hesabix2'); ?>"
|
|
aria-expanded="false"
|
|
aria-controls="mobile-menu"
|
|
>
|
|
<span class="menu-icon-open" aria-hidden="true">
|
|
<span></span><span></span><span></span>
|
|
</span>
|
|
<span class="menu-icon-close is-hidden" aria-hidden="true">
|
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<div id="mobile-menu" class="hesabix-mobile-menu" aria-hidden="true" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e('منوی ناوبری', 'hesabix2'); ?>">
|
|
<div id="mobile-menu-backdrop" class="hesabix-mobile-backdrop" aria-hidden="true"></div>
|
|
<div class="hesabix-mobile-drawer">
|
|
<div class="hesabix-mobile-drawer__head">
|
|
<a href="<?php echo esc_url(home_url('/')); ?>" class="hesabix-mobile-drawer__brand">
|
|
<?php if ($brand_logo_url) : ?>
|
|
<img src="<?php echo esc_url($brand_logo_url); ?>" alt="" width="32" height="32" loading="lazy" decoding="async">
|
|
<?php elseif ($site_icon_url) : ?>
|
|
<img src="<?php echo esc_url($site_icon_url); ?>" alt="" width="32" height="32" loading="lazy" decoding="async">
|
|
<?php endif; ?>
|
|
<span><?php echo esc_html(get_bloginfo('name')); ?></span>
|
|
</a>
|
|
<button type="button" id="menu-close" class="hesabix-header-icon-btn" aria-label="<?php esc_attr_e('بستن منو', 'hesabix2'); ?>">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
|
</button>
|
|
</div>
|
|
<nav class="hesabix-mobile-drawer__nav" aria-label="<?php esc_attr_e('منوی موبایل', 'hesabix2'); ?>">
|
|
<form role="search" method="get" class="hesabix-mobile-search<?php echo ! empty( $hesabix_header_search_product ) ? ' hesabix-mobile-search--product' : ''; ?>" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
|
<label for="mobile-search-field" class="sr-only"><?php echo esc_html( ! empty( $hesabix_header_search_label ) ? $hesabix_header_search_label : __( 'جستجو', 'hesabix2' ) ); ?></label>
|
|
<input type="search" id="mobile-search-field" name="s" class="hesabix-header-search__input" placeholder="<?php echo esc_attr( ! empty( $hesabix_header_search_placeholder ) ? $hesabix_header_search_placeholder : __( 'جستجو در سایت…', 'hesabix2' ) ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>">
|
|
<?php if ( ! empty( $hesabix_header_search_product ) ) : ?>
|
|
<input type="hidden" name="post_type" value="product">
|
|
<?php endif; ?>
|
|
</form>
|
|
<?php
|
|
if (function_exists('hesabix2_render_header_mobile_nav')) {
|
|
hesabix2_render_header_mobile_nav();
|
|
}
|
|
?>
|
|
<?php if (function_exists('hesabix2_wc_render_header_cart_slot')) : ?>
|
|
<?php hesabix2_wc_render_header_cart_slot('mobile-link'); ?>
|
|
<?php endif; ?>
|
|
<?php $hesabix_mobile_arc_url = function_exists( 'hesabix2_fp_arc_url' ) ? hesabix2_fp_arc_url() : ''; ?>
|
|
<div class="hesabix-mobile-drawer__cta">
|
|
<?php
|
|
if ( function_exists( 'hesabix2_render_header_auth_mobile' ) ) {
|
|
hesabix2_render_header_auth_mobile();
|
|
}
|
|
?>
|
|
<?php if ( $hesabix_mobile_arc_url ) : ?>
|
|
<a href="<?php echo esc_url( $hesabix_mobile_arc_url ); ?>" target="_blank" rel="noopener noreferrer" class="hesabix-header-cta hesabix-header-cta--block" <?php echo function_exists( 'hesabix2_entry_link_attrs' ) ? hesabix2_entry_link_attrs( 'arc', $hesabix_mobile_arc_url ) : ''; ?>><?php echo esc_html( function_exists( 'hesabix2_fp_cta_primary_label' ) ? hesabix2_fp_cta_primary_label() : __( 'شروع رایگان', 'hesabix2' ) ); ?></a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
</div>
|