-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
114 lines (96 loc) · 3.27 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
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Gothamish
*/
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site site--mobile-nav">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'gothamish' ); ?></a>
<?php
if ( has_nav_menu( 'network-list' ) ) {
gotham_network_list();
}
?>
<?php
// Site Header Leaderboard Ad Slot.
gotham_display_ad(
'site-header',
[
'mobile' => '320x50',
'tablet' => '468x60',
'desktop' => '970x90',
]
);
?>
<header id="masthead" class="site-header">
<div class="site-header__wrapper">
<div class="site-header__branding">
<?php
the_custom_logo();
$gotham_description = get_bloginfo( 'description', 'display' );
if ( $gotham_description ) {
$logo_link_title = $gotham_description;
} else {
$logo_link_title = get_bloginfo( 'name' );
}
if ( is_front_page() && is_home() ) :
?>
<h1 class="site-header__title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_html( $logo_link_title ); ?>" rel="home"><?php echo gotham_logotype(); ?></a></h1>
<?php
else :
?>
<p class="site-header__title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_html( $logo_link_title ); ?>" rel="home"><?php echo gotham_logotype(); ?></a></p>
<?php
endif;
?>
</div><!-- .site-branding -->
<?php if ( has_nav_menu( 'primary-nav' ) ) : ?>
<nav id="site-navigation" class="site-header__navigation main-navigation">
<button id="main-nav-toggle" class="main-navigation__menu-toggle menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', 'gothamish' ); ?></button>
<?php
// Add search bar to nav before menu.
$menu_prefix_markup = get_search_form( false );
// Check for social links to add to nav after menu.
$menu_suffix_markup = null;
if ( has_nav_menu( 'social-links' ) ) {
$menu_suffix_markup = gotham_social_links( false );
}
wp_nav_menu(
[
'container_class' => 'main-navigation__primary-nav primary-nav',
'menu_class' => 'primary-nav__menu',
'menu_id' => 'primary-nav__menu',
'theme_location' => 'primary-nav',
'items_wrap' => $menu_prefix_markup . '<ul id="%1$s" class="%2$s">%3$s</ul>' . $menu_suffix_markup,
]
);
?>
</nav><!-- #site-navigation -->
<?php endif; ?>
<div class="site-header__utilities">
<?php if ( has_nav_menu( 'social-links' ) ) : ?>
<div class="site-header__social-links">
<?php gotham_social_links(); ?>
</div>
<?php endif; ?>
<div class="site-header__search-form">
<?php get_search_form(); ?>
</div>
</div>
</div>
</header><!-- #masthead -->
<div id="content" class="site-content">