/
header.php
167 lines (116 loc) · 4.6 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
/**
* The header for our theme.
*
* @package politics
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php echo esc_attr( get_bloginfo( 'pingback_url' ) ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?PHP
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
} ?>
<div id="page" class="hfeed site">
<header class="mini-header-wrap" role="banner">
<div class="mini-header">
<div class="row ">
<div class="large-3 columns">
<?php if ( has_nav_menu( 'social' ) ) : ?>
<nav class="social-navigation" role="navigation">
<?php
// Social links navigation menu.
wp_nav_menu( array(
'theme_location' => 'social',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
) );
?>
</nav><!-- .social-navigation -->
<?php endif; ?>
</div><!-- .large-3 -->
<div class="large-9 columns header-contact">
<?php if ( get_theme_mod( 'politics-header-phone') !== '' ) { ?>
<div class="header-phone">
<?php $politics_header_phone = get_theme_mod( 'politics-header-phone', customizer_library_get_default( 'politics-header-phone' ) ); ?>
<a href="tel:+<?php echo esc_attr( $politics_header_phone ); ?>">
<i class="fa fa-phone"></i>
<span><?php echo esc_attr( $politics_header_phone ); ?>
</a>
</div><!-- .header-phone -->
<?php } ?>
<?php if ( get_theme_mod( 'politics-header-address') !== '' ) { ?>
<div class="header-address">
<?php $politics_header_address = get_theme_mod( 'politics-header-address', customizer_library_get_default( 'politics-header-address' ) ); ?>
<a target="_blank" href="http://maps.google.com/?q=<?php echo esc_attr( $politics_header_address ); ?>">
<i class="fa fa-map-marker fa-lg"></i>
<span><?php echo esc_attr( $politics_header_address ); ?>
</a>
</div><!-- .header-address -->
<?php } ?>
</div><!-- .large-9 -->
</div><!-- .row -->
</div><!-- .mini-header -->
</header><!-- .mini-header-wrap -->
<header id="masthead" class="site-header" role="banner">
<div class="row">
<div class="large-12 columns">
<div class="site-branding">
<?php
$politics_logo = get_theme_mod( 'politics-logo', customizer_library_get_default( 'politics-logo' ) );
if ( $politics_logo ) { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img src="<?php echo esc_url( $politics_logo ) ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>">
</a>
<?php } else { ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo esc_attr( get_bloginfo( 'name' ) ); ?></a></h1>
<p class="site-description"><?php echo esc_attr( get_bloginfo( 'description' ) ); ?></p>
<?php } ?>
</div><!-- .site-branding -->
<nav id="site-navigation" role="navigation" aria-label="<?php _e( 'Primary Menu', 'politics' ); ?>">
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => false,
'menu_class' => 'main-navigation',
'walker' => new Politics_Aria_Walker_Nav_Menu(),
'items_wrap' => '<ul id="%1$s" class="%2$s" role="menubar">%3$s</ul>',
)
);
}
?>
</nav><!-- #site-navigation -->
</div><!-- .large-12 -->
</div><!-- .row -->
<?php if ( !is_page_template( 'front-page-template.php' ) ) { ?>
<hr>
<?php } ?>
</header><!-- #masthead -->
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'politics' ); ?></a>
<?php if ( is_page_template( 'front-page-template.php' ) ) { ?>
<div class="home_hero">
<div class="home-header-bg color-overlay clearfix">
<div class="hero-widgets-wrap">
<div class="row">
<div class="large-8 large-centered columns">
<?php if ( is_active_sidebar( 'home-hero' ) ) { ?>
<?php dynamic_sidebar( 'home-hero' ); ?>
<?php } ?>
</div><!-- .large-8 -->
</div><!-- .row -->
</div><!-- .hero-widgets-wrap -->
</div><!-- .header-bg -->
</div><!-- .color-overlay -->
<?php } ?>
<div id="content" class="site-content" role="main">