This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathheader.php
executable file
·262 lines (200 loc) · 6.61 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?php
/**
* The header for our theme.
*
* @package Designer
* @link https://themebeans.com/themes/designer
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<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(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
}
?>
<?php if ( ! is_404() && ! is_page_template( 'template-underconstruction.php' ) ) { ?>
<div id="page-container" class="page-container hfeed">
<header class="header">
<div class="site-title">
<?php designer_site_logo(); ?>
</div>
<?php if ( has_nav_menu( 'primary-menu' ) ) : ?>
<nav id="site-navigation" class="main-navigation nav primary">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary-menu',
'container' => '',
'menu_id' => 'primary-menu',
'menu_class' => 'sf-menu main-menu',
)
);
?>
</nav>
<nav id="site-mobile-navigation" class="mobile-navigation">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary-menu',
'link_before' => '<span>',
'link_after' => '</span>',
'walker' => new DesignerClassMobileNavigationWalker(),
)
);
?>
</nav>
<div class="mobile-menu-toggle"><span></span><span></span><span></span></div>
<?php endif; ?>
<?php if ( true === get_theme_mod( 'portfolio_flyout' ) ) { ?>
<a id="nav-flyout-toggle" class="nav-flyout-toggle" href="javascript:void(0);"></a>
<?php } ?>
<?php if ( true === get_theme_mod( 'social_sharing' ) ) { ?>
<?php get_template_part( 'template-parts/social-sharing' ); ?>
<a id="nav-social-toggle" class="nav-social-toggle" href="javascript:void(0);"></a>
<?php } ?>
<?php
if ( designer_is_woocommerce_activated() ) {
designer_nav_toggles();
}
?>
</header>
<?php if ( ! is_page_template( 'template-portfolio.php' ) && ! is_post_type_archive() ) { ?>
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
if ( is_singular( 'portfolio' ) ) {
$portfolio_title = get_post_meta( $post->ID, '_bean_portfolio_title', true );
$portfolio_meta = get_post_meta( $post->ID, '_bean_portfolio_meta', true );
?>
<header class="entry-header">
<?php if ( 'on' === $portfolio_title ) { ?>
<h1 class="entry-title"><?php echo esc_html( get_the_title() ); ?></h1>
<?php } ?>
<div class="entry-content">
<?php
// Let's check if Beaver Builder exsists.
if ( class_exists( 'FLBuilder' ) ) {
// Now let's check if Beaver Builder is active. Only display this content, if it's not.
if ( ! FLBuilderModel::is_builder_enabled() ) {
the_content();
} else {
the_excerpt();
}
} else {
the_content();
}
?>
<?php if ( 'on' === $portfolio_meta ) { ?>
<div class="project-meta clearfix">
<?php get_template_part( 'template-parts/portfolio-meta' ); ?>
</div>
<?php } ?>
</div>
<?php if ( true === get_theme_mod( 'portfolio_cta' ) ) { ?>
<div class="project-cta">
<div class="project-cta__inner">
<a class="btn"><?php echo esc_html( get_theme_mod( 'portfolio_cta_btn_text' ) ); ?></a>
<?php
// CONTACT CODE
if ( isset( $_POST['submitted'] ) ) {
if ( trim( $_POST['contactName'] ) === '' ) {
$hasError = true;
} else {
$name = trim( $_POST['contactName'] );
}
if ( trim( $_POST['email'] ) === '' ) {
$hasError = true;
} elseif ( ! is_email( trim( $_POST['email'] ) ) ) {
$hasError = true;
} else {
$email = trim( $_POST['email'] );
}
if ( trim( $_POST['phone'] ) === '' ) {
$hasError = true;
} else {
$phone = trim( $_POST['phone'] );
}
if ( trim( $_POST['subject_select'] ) === '' ) {
$hasError = true;
} else {
$subject_select = trim( $_POST['subject_select'] );
}
if ( trim( $_POST['comments'] ) === '' ) {
$hasError = true;
} else {
if ( function_exists( 'stripslashes' ) ) {
$comments = stripslashes( trim( $_POST['comments'] ) );
} else {
$comments = trim( $_POST['comments'] );
}
}
if ( ! isset( $hasError ) ) {
$emailSent = true;
}
}
?>
<?php if ( isset( $emailSent ) && $emailSent == true ) { ?>
<span class="project-cta-alert project-cta-alert--success">
<?php echo apply_filters( 'designer_contactform_success_msg', esc_html__( 'Your message was sent.', 'designer' ) ); ?>
</span>
<?php } // END SUCCESS ALERT ?>
<?php if ( isset( $hasError ) || isset( $captchaError ) ) { ?>
<span class="project-cta-alert project-cta-alert--error">
<?php echo apply_filters( 'designer_contactform_error_msg', esc_html__( 'An error occured. Try again.', 'designer' ) ); ?>
</span>
<?php } // END FAIL ALERT ?>
</div>
</div>
<?php } ?>
</header>
<?php
} else {
$page_title = get_post_meta( $post->ID, '_bean_page_title', true );
$header_tagline = get_post_meta( $post->ID, '_bean_header_tagline', true );
if ( $header_tagline ) {
$tagline_class = '';
} else {
$tagline_class = 'no-tagline';
}
if ( $page_title == 'on' or $header_tagline ) {
echo '<header class="entry-header ' . $tagline_class . '">'; }
if ( $page_title == 'on' ) {
?>
<h1 class="entry-title"><?php echo esc_html( get_the_title() ); ?></h1>
<?php
}
if ( $header_tagline ) {
echo '<div class="entry-content"><p class="cd-headline letters type">' . balancetags( $header_tagline ) . '</p></div>'; }
if ( $page_title == 'on' or $header_tagline ) {
echo '</header>'; }
}
endwhile;
endif;
}
if ( is_page_template( 'template-portfolio.php' ) ) :
$content = $post->post_content;
if ( $content ) {
while ( have_posts() ) :
the_post();
?>
<header class="entry-header">
<div class="entry-content">
<p class="cd-headline letters type">
<?php echo get_the_content(); ?>
</p>
</div>
</header>
<?php
endwhile;
}
endif;
}