This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
120 lines (116 loc) · 6.29 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= (is_home()) ? get_the_title( get_option('page_for_posts', true) ) : the_title(); ?> | <?php bloginfo( 'name' ); ?></title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div class="header__wrapper">
<?php get_template_part( 'template-parts/top-bar' ); ?>
<header class="main-header <?= ($announcement_text || $announcement_link) ? 'announcement-on' : ''; ?>">
<div class="main-header__filling"></div>
<div class="flex-container--between">
<div class="main-navigation__toggler just-relative">
<span class="main-navigation__toggler-content">
<?php esc_html_e( 'Meniu', 'math' ); ?>
</span>
</div>
<div class="main-navigation__toggler--mobile just-relative">
<span><img src="<?= get_template_directory_uri(); ?>/dist/assets/images/hamburger.png" alt="MENU"></span>
</div>
<div class="navbar__brand">
<?php the_custom_logo(); ?>
</div>
<?php if (class_exists( 'WooCommerce' )) : ?>
<div class="navbar__user-area">
<?php math_custom_languages_list(); ?>
<?php wp_nav_menu( array(
'theme_location' => 'language_switcher',
));?>
<?php if ( is_user_logged_in() ) : ?>
<div class="navbar__user-area__login">
<a href="<?= esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>">
<?php esc_html_e( 'Mano paskyra', 'math' ); ?>
</a>
</div>
<div class="navbar__user-area__cart">
<a href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>">
<img src="<?= get_template_directory_uri(); ?>/dist/assets/images/cart.png" alt="Cart" class="navbar__user-area__cart__icon">
<div class="navbar__user-area__cart__count"><p><?= WC()->cart->get_cart_contents_count() ?></p></div>
</a>
</div>
<?php else: ?>
<div class="navbar__user-area__login">
<a href="<?= esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>">
<?php esc_html_e( 'Prisijungti', 'math' ); ?>
</a>
</div>
<div class="navbar__user-area__cart">
<a class="navbar__user-area__cart" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>">
<img src="<?= get_template_directory_uri(); ?>/dist/assets/images/cart.png" alt="Cart" class="navbar__user-area__cart__icon">
<div class="navbar__user-area__cart__count"><p><?= WC()->cart->get_cart_contents_count(); ?></p></div>
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</header>
<?php wp_nav_menu(
array(
'theme_location' => 'mobile_sub_menu',
'container' => 'nav',
'menu_class' => 'nav-mobile--sub'
)
); ?>
</div>
<div class="main-navigation">
<div class="main-navigation__close">
<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-close" viewBox="0 0 64 64"><path d="M32 29.714L53.714 8 56 10.286 34.286 32 56 53.714 53.714 56 32 34.286 10.286 56 8 53.714 29.714 32 8 10.286 10.286 8 32 29.714z" fill="#162317" fill-rule="evenodd"/></svg>
</div>
<div class="flex-container">
<?php wp_nav_menu(
array(
'theme_location' => 'primary_menu',
'container' => 'nav'
)
); ?>
</div>
</div>
<div class="mobile-navigation">
<div class="mobile-navigation__close">
<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-close" viewBox="0 0 64 64"><path d="M32 29.714L53.714 8 56 10.286 34.286 32 56 53.714 53.714 56 32 34.286 10.286 56 8 53.714 29.714 32 8 10.286 10.286 8 32 29.714z" fill="#162317" fill-rule="evenodd"/></svg>
</div>
<div class="flex-container">
<div class="mobile-navigation__menu">
<?php wp_nav_menu(
array(
'theme_location' => 'primary_menu',
'container' => 'nav'
)
); ?>
</div>
</div>
<div class="container">
<?php if (class_exists( 'WooCommerce' )) : ?>
<div class="mobile-navigation__user-area">
<?php if ( is_user_logged_in() ) : ?>
<div class="mobile-navigation__user-area__login">
<a href="<?= esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>">
<?php esc_html_e( 'Mano paskyra', 'math' ); ?>
</a>
</div>
<?php else: ?>
<div class="mobile-navigation__user-area__login">
<a href="<?= esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>">
<?php esc_html_e( 'Prisijungti', 'math' ); ?>
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>