-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathheader.php
More file actions
executable file
·81 lines (71 loc) · 2.95 KB
/
header.php
File metadata and controls
executable file
·81 lines (71 loc) · 2.95 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
<!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
$navbar_position = get_theme_mod( 'navbar_position', 'fixed' ); // Get custom meta-value.
$search_enabled = get_theme_mod( 'search_enabled', '1' ); // Get custom meta-value.
?>
<body <?php body_class( 'mdc-typography' ); ?>>
<?php wp_body_open(); ?>
<div id="wrapper">
<header id="header" class="mdc-top-app-bar mdc-top-app-bar--<?php echo esc_attr( $navbar_position ); ?><?php if ( is_home() || is_front_page() ) : echo ' home'; endif; ?>">
<div class="mdc-top-app-bar__row">
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<a href="<?php echo esc_url( home_url() ); ?>" class="mdc-top-app-bar__title" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php
$header_logo = get_theme_mod( 'header_logo' ); // Get custom meta-value.
if ( ! empty( $header_logo ) ) :
?>
<img src="<?php echo esc_url( $header_logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
<?php
else :
echo esc_attr( get_bloginfo( 'name', 'display' ) );
endif;
?>
</a>
</section>
<?php
if ( '1' === $search_enabled ) :
?>
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end">
<form class="mdc-form-field mdc-form-field--align-end search-form" role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label class="mdc-text-field mdc-text-field--no-label" data-mdc-auto-init="MDCTextField">
<input type="text" name="s" class="mdc-text-field__input" title="<?php esc_attr_e( 'Search', 'my-theme' ); ?>" />
<button type="submit" class="mdc-icon-button material-icons">search</button>
</label>
</form>
</section>
<?php
endif;
?>
</div><!-- /.mdc-top-app-bar__row -->
<div id="tab-bar-menu" class="mdc-tab-bar" role="tablist">
<div class="mdc-tab-scroller">
<div class="mdc-tab-scroller__scroll-area">
<nav id="scrollable-tab-bar-menu" class="mdc-tab-scroller__scroll-content">
<?php
// Loading WordPress Custom Menu (theme_location).
wp_nav_menu(
array(
'container' => '',
//'fallback_cb' => 'WP_MDC_Navwalker::fallback',
'depth' => 1,
'walker' => new WP_MDC_Navwalker(),
'theme_location' => 'main-menu',
'items_wrap' => '%3$s',
)
);
?>
</nav>
</div>
</div><!-- /.mdc-tab-scroller -->
</div><!-- /.mdc-tab-bar -->
</header><!-- /#header -->
<main id="main" class="mdc-layout-grid<?php if ( 'fixed' === $navbar_position ) : echo ' mdc-top-app-bar--prominent-fixed-adjust'; endif; ?>">
<?php if ( ! is_page_template( 'page-full.php' ) ) : ?>
<div class="mdc-layout-grid__inner">
<?php endif; ?>