-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
81 lines (67 loc) · 2.77 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php get_header( 'meta' ); ?>
<header class="site-header" role="banner">
<div class="container site-header-container">
<?php hakama_template( 'header-brand' ) ?>
<nav class="site-header-nav">
<ul class="site-header-lists">
<li class="site-header-list site-header-list-left site-header-menu">
<button class="site-header-button" id="global-nav-toggle">
<i class="fas fa-bars"></i>
<i class="fas fa-times"></i>
<span class="site-header-label"><?php esc_html_e( 'Search Products', 'hakama' ) ?></span>
</button>
</li>
<li class="site-header-list site-header-list-left site-header-list-search">
<button class="site-header-button" data-toggle="modal" data-target="#search-form">
<i class="fa fa-search"></i>
<span class="site-header-label"><?php echo esc_html_x( 'Search Products', 'header-search-button', 'hakama' ) ?></span>
</button>
</li>
<?php if ( is_user_logged_in() ) : ?>
<li class="site-header-list">
<a class="site-header-button" href="<?php echo hakama_account_url(); ?>">
<?php echo get_avatar( get_current_user_id(), 30, '', hakama_short_name(), [ 'class' => 'site-header-avatar' ] ) ?>
<span class="site-header-label"><?php printf( __( 'Howdy, %s!', 'hakama' ), hakama_short_name() ) ?></span>
</a>
</li>
<?php elseif ( !hakama_has_woo() || !is_page( wc_get_page_id( 'myaccount' ) ) ) : ?>
<li class="site-header-list site-header-list-login">
<a class="site-header-button"
href="<?php echo hakama_login_url( $_SERVER[ 'REQUEST_URI' ] ) ?>">
<?php esc_html_e( 'Sign In', 'hakama' ) ?>
</a>
</li>
<li class="site-header-list site-header-list-signup">
<a class="site-header-button" href="<?php echo hakama_registration_url() ?>">
<?php esc_html_e( 'Sign Up', 'hakama' ) ?>
</a>
</li>
<?php endif; ?>
<?php if ( hakama_has_woo() && !is_cart() ) : ?>
<li class="site-header-list site-header-list-cart">
<a class="site-header-button" href="<?php echo wc_get_cart_url() ?>">
<span class="screen-reader-text"><?php esc_html_e( 'Cart', 'hakama' ) ?></span>
<i class="fa fa-shopping-cart"></i>
<?php if ( $count = hakama_cart_count() ) : ?>
<span class="site-header-count"><?php echo $count ?></span>
<?php endif; ?>
</a>
</li>
<?php endif; ?>
</ul>
</nav>
</div>
</header>
<?php if ( has_nav_menu( 'global_menu' ) ) : ?>
<nav class="global-nav" role="navigation">
<div class="container">
<?php wp_nav_menu( [
'theme_location' => 'global_menu',
'container_class' => 'global-nav-list',
'menu_class' => 'global-nav-item',
'depth' => 2,
] ) ?>
</div>
</nav>
<?php endif; ?>
<?php do_action( 'hakama_header_notification' ); ?>