-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
179 lines (141 loc) · 5.51 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
168
169
170
171
172
173
174
175
176
177
178
<?php
/**
* The header for BP Progenitor
*
* 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 BP_Progenitor
*/
?>
<!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="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="site-wrap">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'bp-progenitor' ); ?></a>
<div id="page" class="site">
<header id="masthead" class="site-header">
<?php if( has_header_image() && 'horizontal' === progenitor_opts( 'main_site_menu' ) ) : ?>
<div class="header-background">
<?php endif; ?>
<div class="site-branding">
<?php
if ( 'vertical' === progenitor_opts( 'main_site_menu' ) || progenitor_overlay_logo() ) :
progenitor_custom_logo();
endif;
if ( progenitor_show_title() ) {
if ( is_front_page() && is_home() ) : ?>
<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
<?php else : ?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php
endif;
};
if ( progenitor_show_tagline() ) {
$description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) : ?>
<p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
<?php
endif;
} ?>
</div><!-- .site-branding -->
<?php if( has_header_image() && 'horizontal' === progenitor_opts( 'main_site_menu' ) ) : ?>
</div><!-- // .header-background -->
<?php endif; ?>
<nav id="site-navigation" class="main-navigation site-navs primary-color">
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
<span class="button-label screen-reader-text"><?php esc_html_e( 'Primary Menu', 'bp-progenitor' ); ?></span>
<span class="menu-icon fa fa-lg fa-align-justify" aria-hidden="true"></span>
</button>
<?php
wp_nav_menu( array(
'theme_location' => 'menu-1',
'menu_id' => 'primary-menu',
) );
?>
</nav><!-- #site-navigation -->
<?php
/*
* We display the user & group single object navs within the
* header region under the main nav if main nav vertical & user/group
* navs also set as vert otherwise they appear in home.php
*/
?>
<?php if ( is_buddypress() && 'vertical' == progenitor_menu_style() && progenitor_opts( 'object_nav_main_header' ) ) { ?>
<dl class="bp-object-nav" aria-role="navigation">
<dt class="nav-screen-title">
<?php
if ( bp_is_user() ) {
esc_html_e( 'User Navigation', 'progenitor' );
} elseif ( bp_is_group() ) {
esc_html_e( 'Group Navigation', 'progenitor' );
}
?>
</dt>
<dd>
<?php if ( bp_is_user() ) {
bp_get_template_part( 'members/single/parts/item-nav' );
} elseif ( bp_is_group() ) {
bp_get_template_part( 'groups/single/parts/item-nav' );
} ?>
</dd>
</dl>
<?php } ?>
</header><!-- #masthead -->
<div id="content" class="site-content">
<?php
/*
* Dont display empty meta bar on front page i.e static page/ home page & vertical main menu set
*/
if ( progenitor_display_metabar() ) : ?>
<div class="meta-bar">
<?php if( ( is_page() || is_single() ) && ! is_front_page() ) { ?>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php bp_progenitor_posted_on( $post ); ?>
</div><!-- .entry-meta -->
<?php bp_progenitor_post_navigation( array( 'prev_text' => 'Prev post', 'next_text' => 'Next Post', 'icons' => true ) ); ?>
<?php endif; ?>
<?php if ( bp_is_group() ) : ?>
<p class="highlight group-status">
<?php esc_html( bp_progenitor_group_status() ) . _e(' Group', 'bp-progenitor'); ?>
</p>
<?php endif; ?>
<?php if ( bp_is_user() ) : ?>
<?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?>
<span class="user-nicename" aria-role="hidden">@<?php bp_displayed_user_mentionname(); ?></span>
<?php progenitor_member_last_active(); ?>
<?php endif; ?>
<?php endif; ?>
</header>
<?php } elseif( is_category() || is_archive() || is_tag() ) { ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' );
?>
</header>
<?php } elseif ( is_search() ) { ?>
<header class="page-header">
<h1 class="page-title"><?php _e('Search Results', 'bp-progenitor'); ?></h1>
</header>
<?php } elseif ( is_home() && ! is_front_page() ) { ?>
<header>
<h1 class="page-title"><?php single_post_title() . _e(': Index', 'bp-progenitor'); ?></h1>
</header>
<?php } elseif( is_404() ) { ?>
<header class="page-header">
<h1 class="page-title"><?php _e( 'Page not found', 'bp-progenitor' ); ?></h1>
</header>
<?php } ?>
</div>
<?php endif; ?>