-
Notifications
You must be signed in to change notification settings - Fork 1
/
content.php
527 lines (421 loc) · 19.8 KB
/
content.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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<?php
/**
* All content types handled fron this file
* @uses is_page()....
*
* Attachment and thumbnail use custom 400x300px but adjust
* display size according to orientation, down to 180x180
* @4x3 standard computer media ratio - (not 16:9)
* @180x180px thumbnail squared = `appeal-thumbnail`
* @since 1.0.7 Modal section moved to bottom.
*
*/
/**
* Start Article Content case
* ************************************************************ */
$alts = esc_attr( get_the_title( $post->ID ) );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>
itemscope itemtype="http://schema.org/Article">
<div class="article-inner">
<div class="entry-content">
<?php if ( is_front_page() && is_home() ) {
// Default if-homepage is blog. Has thumb in excerpt
?>
<div class="post_content appeal_blog">
<?php get_template_part('content', 'header' ); ?>
<div class="row">
<div class="after-content-header">
<?php if( has_post_thumbnail() ) : ?>
<div class="col-xs-3 col-sm-3 col-lg-4">
<?php // Check which Post Thumbnail is assigned to post.
if ( has_post_thumbnail( 'appeal-thumbnail' ) ) { ?>
<?php printf( '<a class="appeal-imglink"
href="' . esc_url( get_permalink( $post->ID ) ) . '"
title ="' . esc_attr( get_the_title( $post->ID ) ) . '">'
); ?>
<?php the_post_thumbnail( 'appeal-featured', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
<?php } else {
// ends if has custom thumb size
?>
<?php printf( '<a class="appeal-imglink"
href="' . esc_url( get_permalink( $post->ID ) ) . '"
title ="' . esc_attr( get_the_title( $post->ID ) ) . '">'
); ?>
<?php the_post_thumbnail('thumbnail', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
<?php }
//ends if has wp_thumbnail
?>
</div>
<div class="col-xs-9 col-sm-9 col-lg-8">
<?php else : ?>
<div class="col-xs-12 col-sm-12 col-lg-12">
<?php endif;
// ends if has thumbnail
?>
<div class="inner_content">
<?php the_excerpt() ?>
</div>
</div>
</div>
</div>
</div>
<footer class="metafoot">
<?php get_template_part('part', 'metadata' ); ?>
</footer>
<?php } elseif ( is_home() ) {
//Blog page if theme homepage is static. No thumb.
?>
<section class="post_content">
<?php get_template_part('content', 'header' ); ?>
<?php the_excerpt(); ?>
</section><div class="clearfix"></div>
<footer class="meta-footer">
<?php get_template_part('part', 'metadata' ); ?>
</footer>
<?php } elseif ( is_single() ) {
/**
* Single post page will give attachment a link to Attachment template
*/
?>
<section id="appeal-content" class="post_content">
<?php get_template_part('content', 'header' ); ?>
<div class="row">
<div class="after-content-header">
<?php if( has_post_thumbnail() ) :
?>
<?php
//set caption var for titles and caption
$get_description = get_post(
get_post_thumbnail_id())->post_excerpt;
// check which Post Thumbnail is assigned to page.
if ( has_post_thumbnail( 'appeal-thumbnail' ) ) {
//SHOW APPEAL THUMB
?>
<div class="col-xs-6 col-sm-6 col-lg-7">
<a class="appeal-imglinks"
href="<?php echo esc_url( get_attachment_link(
get_post_thumbnail_id() ) ); ?>"
<?php if( !empty ( $get_description ) ) { ?>
title="<?php echo esc_attr( $get_description ); ?>"<?php } ?>>
<?php the_post_thumbnail( 'appeal-featured', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
<?php if( !empty( $get_description ) )
{
//If description-caption is not empty show the div
?>
<div class="featured_caption"
title="<?php echo esc_attr( $get_description ); ?>">
<?php echo esc_html( $get_description ); ?>
</div>
<?php
} ?>
</div>
<?php
} else {
//SHOW WP ATTACHMENT THUMB
?>
<div class="col-xs-6 col-sm-6 col-lg-7">
<a class="appeal-imglinks"
href="<?php echo esc_url( get_attachment_link(
get_post_thumbnail_id() ) ); ?>"
<?php if( !empty ( $get_description ) ) { ?>
title="<?php echo esc_attr( $get_description ); ?>"<?php } ?>>
<?php the_post_thumbnail('thumbnail', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
<?php if(!empty($get_description)){
//If description-caption is not empty show the div
?>
<div class="featured_caption">
<?php echo esc_html( $get_description ); ?>
</div>
<?php } ?>
</div>
<?php
//ends wp thumb
} ?>
<?php else :
echo '<div class="no-thumb"></div>';
endif;
//end of check for thumbnail
?>
<?php
// Check if theme mod Pullquote uusage is activated.
$theme_modEx = get_theme_mod(
'appeal_custom_teaser_usage_setting', 'none' );
if( $theme_modEx == "block" )
:
?>
<?php if ( has_excerpt( $post->ID ) )
{ ?>
<div class="col-xs-6 col-sm-6 col-lg-5">
<div class="pullquote">
<aside>
<?php the_excerpt() ?>
</aside>
</div>
</div><div class="clearfix"></div>
<?php
}
endif;
//ends .after-content-header .row
?>
</div>
<div class="<?php echo esc_attr( appeal_post_formats() ); ?>">
<div class="inner_content">
<?php the_content(''); ?>
</div>
</div>
<div class="pagination">
<?php wp_link_pages( array(
'before' => '<p class="nextpage-pagination">'
. __( 'Pages : ', 'appeal' ),
'after' => '</p>',
'link_before' => '<span class="space">',
'link_after' => '<span class="space">',
'next_or_number' => 'number',
'separator' => ' ',
'pagelink' => '%',
'echo' => 1
)
); ?>
</div>
</section><div class="clearfix"></div>
<footer class="meta-footer">
<?php get_template_part('part', 'metadata' ); ?>
</footer>
<?php comments_template(); ?>
<div class="row"><hr class="short"></div>
<?php } elseif ( is_page() ) {
/**
* Page template page default
*/
?>
<section id="appeal-content" class="post_content">
<?php get_template_part('content', 'header' ); ?>
<div class="row">
<div class="after-content-header">
<?php
// Check if theme mod Pullquote uusage is activated.
$theme_modEx = get_theme_mod( 'appeal_custom_teaser_usage_setting', 'none' );
if( $theme_modEx == "block" )
{
?>
<?php if( has_post_thumbnail() ) :
// Check for thumbnail
?>
<?php
// Check which Post Thumbnail is assigned to page.
if ( has_post_thumbnail( 'appeal-thumbnail' ) )
{
?>
<div class="col-xs-6 col-sm-6 col-lg-7">
<a class="appeal-imglinks"
href="<?php echo esc_url( get_attachment_link(
get_post_thumbnail_id() ) ); ?>">
<?php the_post_thumbnail( 'appeal-featured', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
</div>
<?php
} else
{ ?>
<div class="col-xs-6 col-sm-6 col-lg-7">
<a class="appeal-imglinks"
href="<?php echo esc_url( get_attachment_link(
get_post_thumbnail_id() ) ); ?>">
<?php the_post_thumbnail( 'thumbnail', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
</div>
<?php
} // ends thumbnail choices
?>
<?php else : echo '<div class="no-thumb"></div>';
//ends thumbnail found
endif; ?>
<div class="col-xs-6 col-sm-6 col-lg-5">
<?php if ( has_excerpt( $post->ID ) ) { ?>
<div class="pullquote">
<aside>
<?php
$page = get_post();
$the_excerpt = $page->post_excerpt;
echo esc_html( $the_excerpt );
?>
</aside>
</div>
<?php } else { ?><div class="no-excerpt"></div><?php } ?>
</div>
<?php
} else
{
//now do this if excerpt is NOT used as Pullquote
?>
<?php if( has_post_thumbnail() ) :
// Run again but without Pulquote
?>
<?php
// check which Post Thumbnail is assigned to page.
if ( has_post_thumbnail( 'appeal-thumbnail' ) )
{
?>
<div class="col-sm-12">
<a class="appeal-imglinks"
href="<?php echo esc_url( get_attachment_link(
get_post_thumbnail_id() ) ); ?>">
<?php the_post_thumbnail( 'appeal-featured', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
</div>
<?php
} else
{ ?>
<div class="col-sm-12">
<a class="appeal-imglinks"
href="<?php echo esc_url( get_attachment_link(
get_post_thumbnail_id() ) ); ?>">
<?php the_post_thumbnail( 'thumbnail', array(
'itemprop' => 'image',
'class' => 'img-responsive appeal-thumbnail',
'alt' => $alts ) ); ?></a>
</div>
<?php
}
//ends thumbnail choices
?>
<?php else : echo '<div class="no-thumb"></div>';
endif; ?>
<?php
}
//ends .after-content-header .row and Pullquote not used choice
?>
</div><!-- ends content-after-header -->
<div class="inner_content">
<?php the_content(''); ?>
</div><div class="clearfix"></div>
<div class="pagination">
<?php wp_link_pages( array(
'before' => '<p class="nextpage-pagination">'
. __( 'Pages : ', 'appeal' ),
'after' => '</p>',
'link_before' => '<span class="space">',
'link_after' => '<span class="space">',
'next_or_number' => 'number',
'separator' => ' ',
'pagelink' => '%',
'echo' => 1
)
); ?>
</div>
</div>
</section><div class="clearfix"></div>
<footer class="meta-footer">
<ul class="metas list-inline">
<li><?php edit_post_link(__( 'Edit', "appeal"), ' '); ?></li>
</ul>
</footer>
<?php comments_template(); ?>
<div class="row"><hr class="short"></div>
<?php } else {
// ---------------- 4-everything else
?>
<section class="post_content">
<?php get_template_part('content', 'header' ); ?>
<div class="after-content-header">
<?php
// check if the post has a Post Thumbnail assigned to it.
if ( has_post_thumbnail() ) {
the_post_thumbnail( 'thumbnail', array(
'itemprop' => 'image',
'class' => 'appeal-thumbnail alignleft',
'alt' => '' ) );
} else {
echo '<div class="no-thumb"></div>'; }
?>
<div class="inner_content">
<?php the_content( '', true ); ?>
<div class="pagination">
<?php wp_link_pages(); ?>
</div>
</div>
</section><div class="clearfix"></div>
<footer class="meta-footer">
<?php get_template_part('part', 'metadata' ); ?>
</footer>
<aside="comments-aside">
<?php comments_template(); ?>
</aside>
<?php } //ends all content type check
?>
</div>
</div>
</article><div class="clearfix"></div>
<div id="theAuthor" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">X</button>
<h2 class="modal-title"><?php echo esc_html( get_the_author_meta(
'first_name' ) ); ?>
<span class="sepspace"> </span>
<?php echo esc_attr( nl2br( get_the_author_meta( 'last_name' ) ) ); ?>
<span class="screen-reader-text">
<?php esc_attr_e( 'Information about the author you selected',
'appeal' ); ?></span>
</h2>
</div>
<div class="modal-body">
<p><?php esc_html_e( 'Author: ', 'appeal' );
echo esc_attr(get_the_author_meta( 'nicename' )); ?></p>
<ul class="list-group">
<li class="list-group-item">
<?php echo esc_attr(nl2br( the_author_meta('description') )); ?></li>
<li class="list-group-item">
<a href="<?php echo esc_url(the_author_meta( 'url' ) ); ?>"
title="<?php the_author(); ?>">
<?php echo esc_url(the_author_meta( 'url' ) ); ?>
<span class="screen-reader-text">
<?php esc_html_e( 'link to author', 'appeal' ); ?>
<?php echo esc_url(the_author_meta( 'url' ) ); ?></span></a></li>
<li class="list-group-item"><?php
esc_html_e( 'Author Page and Archives for ',
'appeal' ); the_author_posts_link(); ?></li>
<li class="list-group-item"><b><?php the_author_posts(); ?></b>
<span class="screen-reader-text">
<?php esc_html_e( 'Number of articles by this author, ',
'appeal'); ?>
<?php the_author_posts(); ?></span>
<?php esc_html_e( 'Articles by ', 'appeal' ); ?> <?php the_author(); ?></li>
</ul>
</div>
<div class="modal-footer">
<nav class="modal-nav">
<em class="text-muted"><?php esc_html_e( 'E-Mail: ', 'appeal' ); ?>
<?php echo esc_html( the_author_meta('user_email') ); ?></em>
<span class="screen-reader-text">
<?php esc_html_e( 'email link text to author', 'appeal' ); ?></span>
<button type="button"
class="btn btn-default btn-md"
data-dismiss="modal"
title="<?php esc_attr_e( 'Close', 'appeal' ); ?>">
<?php esc_html_e( 'Close', 'appeal' ); ?>
</button>
</nav>
</div>
</div>
</div>
</div>