This repository has been archived by the owner on Apr 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
content.php
109 lines (89 loc) · 2.5 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
<?php
/**
* content.php
*/
global $band_class;
$post_class = 'entry';
$title_class = is_singular() ? '' : 'h2';
$is_card = is_sticky() && !is_singular() && !is_search();
$has_thumbnail = has_post_thumbnail( get_the_ID() );
do_action('tha_entry_before');
?>
<article <?php post_class($post_class); ?>>
<?php
do_action('tha_entry_top');
$title_class = 'title';
if ( $is_card ) {
?><div class="card card-block sticky"><?php
$title_class .= ' h3 card-title';
} elseif ( is_search() ) {
$title_class .= ' h4';
}
?><header class="<?= implode( ' ', apply_filters('post_meta_class', array('meta')) ) ?>"><?php
if ($has_thumbnail && is_singular()) {
$thumbnail = get_the_post_thumbnail( get_the_ID(),
'featured-image',
array('class' => 'img-featured ' . FEATURED_IMAGE_CLASS) );
$fn = 'featured_image_' . get_the_ID();
bs4_inject_feature($fn, $thumbnail);
}
$_t = trim( get_the_title() );
if (empty($_t)) $_t = false;
if (is_singular()) {
if ($_t) {
?><h1 class="<?= $title_class ?>"><?= $_t ?></h1><?php
}
} else {
?><h2 class="<?= $title_class ?>"><a href="<?php the_permalink(); ?>"><?php
if (!$_t) {
bs4_i('link');
} else {
echo $_t;
}
?></a></h2><?php
}
if (is_singular() && !is_page()) { ?><p class="meta-data text-muted"><?php bs4_post_meta(); ?></p><?php }
?></header><?php
if ( $is_card ) {
?><span class="card-text"><?php
}
if ( is_search() ) {
the_excerpt();
} else {
if ($has_thumbnail && !is_singular()) {
$thumbnail = get_the_post_thumbnail( get_the_ID(),
'post-thumbnail',
array('class' => 'media-object ' . POST_THUMBNAIL_CLASS) );
?><div class="media"><a class="media-left" href="<?php the_permalink(); ?>"><?php
echo $thumbnail;
?></a><div class="media-body"><?php
}
do_action('tha_entry_content_before');
the_content('More...'); // display Post
do_action('tha_entry_content_after');
if ($has_thumbnail && !is_singular()) {
?></div></div><?php
}
}
$link = get_edit_post_link();
if (is_singular() && $link) { ?>
<footer class="meta">
<p class="meta-data"><?php
echo '<a href="' . $link . '" class="btn btn-outline-warning btn-sm small hidden-print"' .
'title="Edit post">' . get_bs4_i('edit', '', ' ') . 'Edit</a>';
/* $link = get_delete_post_link();
if ($link)
echo ' <a href="' . $link . '" class="btn btn-outline-danger btn-sm small"' .
'title="Delete post">' .
get_bs4_i('trash', '', ' ') . 'Delete</a>'; */
?></p>
</footer>
<?php }
if ( $is_card ) {
?></span></div><?php
}
do_action('tha_entry_bottom');
?>
</article>
<?php
do_action('tha_entry_after');