-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
337 lines (278 loc) · 15.8 KB
/
single.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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<?php
/**
* Single
*/
get_header();
$disableauthorbox = get_theme_mod('disable_authorbox_sectionarticles');
$disablereadingtime = get_theme_mod('disable_readingtime_sectionarticles');
$disabledate = get_theme_mod('disable_date_sectionarticles');
$disableshare = get_theme_mod('disable_share_sectionarticles');
$disablerp = get_theme_mod('disable_rp_sectionarticles');
$disablecats = get_theme_mod('disable_cats_sectionarticles');
$disabletags = get_theme_mod('disable_tags_sectionarticles');
$hide_featimg = get_post_meta(get_the_ID(), "hide_featured_image_hide_featured_image_on_post", true);
$tall_featimg = get_post_meta(get_the_ID(), "tall_featured_image_tall_featured_image_on_post", true);
$fullw_featimg = get_post_meta(get_the_ID(), "full_width_featured_image_full_width_featured_image_on_post", true);
$text_before_follow = get_theme_mod('text_before_follow', '<b>Follow us</b> on');
$fb_url = get_theme_mod('fb_url');
$twitter_url = get_theme_mod('twitter_url');
$youtube_url = get_theme_mod('youtube_url');
$pinterest_url = get_theme_mod('pinterest_url');
$linkedin_url = get_theme_mod('linkedin_url');
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>">
<?php
if (has_post_thumbnail()) {
if (!$hide_featimg) {
get_template_part('partials/headerpost', 'default');
} else if ($fullw_featimg) {
get_template_part('partials/headerpost', 'fullimage');
} else if ($tall_featimg) {
get_template_part('partials/headerpost', 'tallimage');
}
}
?>
<div class="alignfullincol">
<div class="container-fluid max1140">
<!-- row -->
<div class="row mb-5 mt-5">
<!-- main column -->
<div class="col-md-8">
<!-- unless featured image is hidden or not present -->
<?php if (($hide_featimg) || (!has_post_thumbnail())) { ?>
<div class="articleheader jumbotron jumbotron-fluid removetoppadding mb-5 pl-0 pt-0 pb-0 pr-0 bg-transparent position-relative">
<p class="text-uppercase font-weight-bold articleheader-category">
<?php get_template_part('partials/headerpost', 'cats'); ?>
</p>
<h1 class="display-4 article-headline mb-3"><?php the_title(); ?></h1>
<?php get_template_part('partials/headerpost', 'meta'); ?>
</div>
<?php
} ?>
<!-- end unless featured image hidden or not present -->
<!-- widget before article -->
<?php if (is_active_sidebar('sidebar-before-post')) : ?>
<div id="sidebar-before-post" class="sidebar-before-post widget-area" role="complementary">
<?php dynamic_sidebar('sidebar-before-post'); ?>
</div>
<?php endif; ?>
<!-- end widget before article -->
<!-- worksheet exerpt before article -->
<?php if (!in_category(110)): // if not in category how-to?>
<div class="excerpt">
<?php the_excerpt();
$key_worksheet_topic_url_field = get_post_meta( get_the_ID(), 'worksheet_topic_url_field', true ); //output value: URL ?>
<p>External link to: <a target="_blank" rel="noopener noreferrer" onclick="gtag('event', 'visit_exercise', {'event_category': 'resources', 'event_label': 'worksheet'});" href="<?php echo $key_worksheet_topic_url_field?>"><?php _e( the_title(), 'worksheet' ); ?></a> Topic.</p>
<hr> <br> </div>
<?php endif; ?>
<!-- end worksheet exeropt before article -->
<article class="article-post">
<?php the_content(); ?>
<div class="clearfix"></div>
</article>
<!-- worksheet exercises after article -->
<?php
if (!in_category(110) && class_exists('WorkSheet_Template_Loader')) {
echo do_shortcode('[worksheet_content_templates]'); //shortcoded defined in functions.php
}
?>
<!-- end worksheet exercises after article -->
<!-- tags -->
<div class="after-post-tags">
<?php if ($disabletags == 0) { ?>
<div class="post-categories aretags">
<?php
if (is_array(get_the_tags($post->ID)) || is_object(get_the_tags($post->ID))) :
foreach (get_the_tags($post->ID) as $tag) {
echo '<a class="tag-link bg-light" href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a> ';
}
endif;
?>
<!-- worksheet custom taxonomy -->
<?php echo do_shortcode('[custom_taxonomy_shortcode]'); ?>
<!-- end worksheet custom taxonomy -->
</div>
<?php
} ?>
</div>
<!-- end tags -->
<!-- widget after article -->
<?php if (is_active_sidebar('sidebar-after-post')) : ?>
<div id="sidebar-after-post" class="sidebar-after-post widget-area" role="complementary">
<?php dynamic_sidebar('sidebar-after-post'); ?>
</div>
<?php endif; ?>
<!-- end widget after article -->
<!-- author box -->
<?php if ($disableauthorbox == 0) { ?>
<div class="d-flex mt-5 mb-5 align-items-center">
<div class="col-2">
<a href="<?php echo get_author_posts_url($post->post_author); ?>">
<?php echo get_avatar(get_the_author_meta('user_email'), '80', null, null, array('class' => array('rounded-circle imgavt mr-4'))); ?>
</a>
</div>
<div class="ml-2">
<a class="text-muted" href="<?php echo get_author_posts_url($post->post_author); ?>">
<h5><?php _e('Written by ', 'mundana'); ?> <span class="text-capitalize"><?php echo get_the_author_meta('display_name'); ?></span>
</h5>
</a>
<span class="text-muted d-block mb-2">
<?php echo the_author_meta('description'); ?>
</span>
<span class="text-muted d-block">
<a href="<?php echo get_author_posts_url($post->post_author); ?>" class="btn btn-outline-success btn-sm">Profile</a>
</span>
</div>
</div>
<?php
} ?>
<!-- end author box -->
</div>
<!-- end main column -->
<!-- share -->
<div class="<?php if (!is_active_sidebar('sidebar-posts')) { ?> col-md-2 mb-4 <?php
} else {
echo 'col-md-1';
} ?> order-md-first">
<div class="sticky-top sticky-sidebar-offset">
<div class="share text-center">
<div class="sidebarapplause">
<?php
if (class_exists('WPClapsApplause')) {
echo do_shortcode('[wp_claps_applause ]');
}
?>
</div>
<?php if ($disableshare == 0) { ?>
<p class="sharecolour">
<?php _e('Share', 'mundana'); ?>
</p>
<?php mundana_share_post(); ?>
<?php
} ?>
<?php if (comments_open() || get_comments_number()) : ?>
<div class="sep"></div>
<div class="d-none d-md-block">
<p>
<?php _e('Reply', 'mundana'); ?>
</p>
<ul>
<li>
<a class="smoothscroll" href="#comments"><?php printf(_nx('1', '%1$s', get_comments_number(), 'comments title', 'mundana'), number_format_i18n(get_comments_number()), get_the_title()); ?><br />
<svg class="svgIcon-use" width="29" height="29" viewBox="0 0 29 29">
<path d="M21.27 20.058c1.89-1.826 2.754-4.17 2.754-6.674C24.024 8.21 19.67 4 14.1 4 8.53 4 4 8.21 4 13.384c0 5.175 4.53 9.385 10.1 9.385 1.007 0 2-.14 2.95-.41.285.25.592.49.918.7 1.306.87 2.716 1.31 4.19 1.31.276-.01.494-.14.6-.36a.625.625 0 0 0-.052-.65c-.61-.84-1.042-1.71-1.282-2.58a5.417 5.417 0 0 1-.154-.75zm-3.85 1.324l-.083-.28-.388.12a9.72 9.72 0 0 1-2.85.424c-4.96 0-8.99-3.706-8.99-8.262 0-4.556 4.03-8.263 8.99-8.263 4.95 0 8.77 3.71 8.77 8.27 0 2.25-.75 4.35-2.5 5.92l-.24.21v.32c0 .07 0 .19.02.37.03.29.1.6.19.92.19.7.49 1.4.89 2.08-.93-.14-1.83-.49-2.67-1.06-.34-.22-.88-.48-1.16-.74z">
</path>
</svg>
</a>
</li>
</ul>
</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- end share -->
<!-- sidebar posts -->
<?php if (is_active_sidebar('sidebar-posts')) : ?>
<div class="col-lg-3">
<div id="sidebar-posts" class="sidebar-posts widget-area" role="complementary">
<?php dynamic_sidebar('sidebar-posts'); ?>
<!-- worksheet related exercises after sidebar -->
<?php if (!in_category(110)) {
if (!in_category(142)) { // if not in category how-to ?>
<form method="post" onclick="gtag('event', 'view_info', {'event_category': 'information', 'event_label': 'show_info'});" action="<?php the_permalink()?>#learning"> <?php
?> <input class="summaryblock4" type="submit" name="button_worksheet_search_filter" aria-labelledby="buttonText4" value="Show filters"/>
</form> <?php
if ( isset($_POST['button_worksheet_search_filter'])):
?> <style> .summaryblock4 { display: none !important;} </style>
<h5 class="font-weight-bold spanborder">Filter by content</h5> <?php
if (in_category('grammar')){ echo do_shortcode('[searchandfilter id="2302"]'); }
elseif (in_category('culture')){ echo do_shortcode('[searchandfilter id="2306"]'); }
elseif (in_category('orthography')){ echo do_shortcode('[searchandfilter id="2307"]'); }
elseif (in_category('vocabulary')){ echo do_shortcode('[searchandfilter id="2303"]'); }
endif;
?>
<br>
<h5 class="font-weight-bold spanborder">Related exercises</h5>
<?php echo do_shortcode("[display_posts_shortcode]");
}
} ?>
<!-- end worksheet related exercises after sidebar -->
</div>
</div>
<?php endif; ?>
<!-- end sidebar posts -->
</div><!-- end row -->
</div><!-- end container-fluid -->
</div><!-- end alignfullincol -->
</div>
<!-- end post id -->
<?php endwhile; ?>
<?php else : ?>
<p><?php _e('Sorry, no posts matched your criteria.', 'mundana'); ?></p>
<?php endif; ?>
<!-- related posts -->
<?php if ($disablerp == 0) { ?>
<?php echo mundana_related_posts() ?>
<?php
} ?>
<!-- end related posts -->
<!-- comments -->
<?php
if (comments_open() || get_comments_number()) :
comments_template();
endif;
?>
<!-- end comments -->
<!-- bottom fixed bar -->
<div class="alertbar">
<div class="container">
<?php $next_post = get_next_post(); ?>
<div class="d-flex <?php if ((is_a($next_post, 'WP_Post')) && (true == get_theme_mod('show_nextpost', true))) {
echo 'justify-content-md-center justify-content-lg-between';
} else {
echo 'justify-content-center';
} ?> align-items-center">
<div class="follow-links">
<?php echo do_shortcode($text_before_follow); ?>
<?php if (true == get_theme_mod('show_fb_btn', true)) { ?>
<a target="_blank" href="<?php echo $fb_url; ?>" class="followlink text-fbblue"><i class="fa fa-facebook"></i></a>
<?php
} ?>
<?php if (true == get_theme_mod('show_twitter_btn', true)) { ?>
<a target="_blank" href="<?php echo $twitter_url; ?>" class="followlink text-twblue"><i class="fa fa-twitter"></i></a>
<?php
} ?>
<?php if (true == get_theme_mod('show_youtube_btn', true)) { ?>
<a target="_blank" href="<?php echo $youtube_url; ?>" class="followlink text-youtubered"><i class="fa fa-youtube"></i></a>
<?php
} ?>
<?php if (true == get_theme_mod('show_pinterest_btn', true)) { ?>
<a target="_blank" href="<?php echo $pinterest_url; ?>" class="followlink text-pinterestred"><i class="fa fa-pinterest"></i></a>
<?php
} ?>
<?php if (true == get_theme_mod('show_linkedin_btn', true)) { ?>
<a target="_blank" href="<?php echo $linkedin_url; ?>" class="followlink text-linkedinblue"><i class="fa fa-linkedin"></i></a>
<?php
} ?>
</div>
<?php
if (true == get_theme_mod('show_nextpost', true)) {
if (is_a($next_post, 'WP_Post')) : ?>
<div class="d-none d-lg-flex pt-3 pb-3 align-items-center">
<small class="font-weight-light mr-2"><?php _e('Up Next:', 'mundana'); ?></small>
<a class="text-dark font-weight-bold text-right d-flex align-items-center upnext" href="<?php echo get_permalink($next_post->ID); ?>">
<?php echo get_the_post_thumbnail($next_post->ID, 'thumbnail'); ?>
<?php echo get_the_title($next_post->ID); ?>
</a>
</div>
<?php endif; ?>
<?php
} ?>
</div>
</div>
</div>
<!-- end bottom fixed bar -->
<?php get_footer(); ?>