Repository navigation
Expand file tree
/
Copy pathheader.php
More file actions
executable file
·127 lines (112 loc) · 3.19 KB
/
Copy pathheader.php
File metadata and controls
executable file
·127 lines (112 loc) · 3.19 KB
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
121
122
123
124
125
126
127
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
wp_head();
?>
</head>
<?php
$color_scheme = get_theme_mod( 'color_scheme', 'light' ); // Color scheme.
$navbar_position = get_theme_mod( 'navbar_position', 'left' ); // Get custom meta-value.
$search_enabled = get_theme_mod( 'search_enabled', '1' ); // Get custom meta-value.
$header_logo = get_theme_mod( 'header_logo' ); // Get custom meta-value.
$output_header_logo = get_bloginfo( 'name', 'display' );
if ( ! empty( $header_logo ) ) :
$output_header_logo = '<a href="' . esc_url( home_url() ) . '" class="site-title" title="' . esc_attr( $output_header_logo ) . '" rel="home"><img src="' . esc_url( $header_logo ) . '" alt="' . esc_attr( $output_header_logo ) . '" /></a>';
endif;
?>
<body <?php body_class( esc_attr( $color_scheme ) ); ?>>
<?php wp_body_open(); ?>
<div>
<!-- Sidebar "Mobile" -->
<button id="toggle-sidebar-s" class="s extra circle" data-ui="#sidebar-s">
<i>menu</i>
</button>
<dialog class="primary-container left scroll s" id="sidebar-s">
<header>
<div class="top-bar">
<button class="extra circle transparent" data-ui="#sidebar-s">
<i>close</i>
</button>
<?php
if ( '1' === $search_enabled ) :
?>
<button data-ui="#search-modal" class="extra circle transparent">
<i>search</i>
</button>
<?php
endif;
?>
</div>
</header>
<?php
echo $output_header_logo;
?>
<nav>
<?php
// Loading WordPress Custom Menu (theme_location).
wp_nav_menu(
array(
'container' => '',
'walker' => new Material_Navwalker(),
'theme_location' => 'main-menu',
'items_wrap' => '<ul class="list">%3$s</ul>',
)
);
?>
</nav>
</dialog>
<!-- Sidebar "Desktop" -->
<nav id="sidebar" class="primary-container m l scroll max <?php echo esc_attr( $navbar_position ); ?>">
<header>
<div class="top-bar">
<button id="toggle-sidebar" class="m l extra circle transparent">
<i>menu_open</i>
</button>
<?php
if ( '1' === $search_enabled ) :
?>
<button data-ui="#search-modal" class="extra circle transparent">
<i>search</i>
</button>
<?php
endif;
?>
</div>
<?php
echo $output_header_logo;
?>
</header>
<?php
// Loading WordPress Custom Menu (theme_location).
wp_nav_menu(
array(
'container' => '',
'walker' => new Material_Navwalker(),
'theme_location' => 'main-menu',
'items_wrap' => '%3$s',
)
);
?>
</nav>
<main id="main" class="responsive large-padding">
<?php
if ( ! is_page_template( 'page-full.php' ) ) :
echo '<div class="grid">';
endif;
if ( '1' === $search_enabled ) :
?>
<dialog id="search-modal">
<form role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="active">
<div class="field label border">
<input type="text" name="s" title="<?php esc_attr_e( 'Search', 'my-theme' ); ?>" />
<label><?php esc_html_e( 'Search', 'my-theme' ); ?></label>
</div>
</div>
</form>
</dialog>
<?php
endif;