-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent-single.php
More file actions
67 lines (47 loc) · 1.8 KB
/
content-single.php
File metadata and controls
67 lines (47 loc) · 1.8 KB
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
<article class="post">
<h2><?php the_title(); ?></h2>
<p class="post-info"><?php the_time('F j, Y g:i a'); ?> | by <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author(); ?></a> | Posted in
<?php
$categories = get_the_category();
$separator = ", ";
$output = '';
if ($categories) {
foreach ($categories as $category) {
$output .= '<a href="' . get_category_link($category->term_id) . '">' . $category->cat_name . '</a>' . $separator;
}
echo trim($output, $separator);
}
?>
</p>
<?php the_post_thumbnail('banner-image'); ?>
<?php the_content(); ?>
<div class="about-author clearfix">
<div class="about-author-image">
<?php echo get_avatar(get_the_author_meta('ID'), 512) ?>
<p><?php echo get_the_author_meta('nickname') ?></p>
</div>
<?php $otherAuthorPosts = new WP_Query(array(
'author' => get_the_author_meta('ID'),
'posts_per_page' => 3,
'post__not_in' => array(get_the_ID())
)); ?>
<div class="about-author-text">
<h3>About the Author</h3>
<?php echo wpautop(get_the_author_meta('description')) ?>
<?php if ($otherAuthorPosts->have_posts()) { ?>
<div class="other-posts-by">
<h4>Other posts by <?php echo get_the_author_meta('nickname') ?></h4>
<ul>
<?php while ($otherAuthorPosts->have_posts()) {
$otherAuthorPosts->the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title() ?></a></li>
<?php } ?>
</ul>
</div>
<?php } wp_reset_postdata() ?>
<?php if (count_user_posts(get_the_author_meta('ID')) > 3) { ?>
<a class="btn-a" href="<?php echo get_author_posts_url(get_the_author_meta('ID')) ?>">View all posts by <?php echo get_the_author_meta('nickname') ?></a>
<?php } ?>
</div>
</div>
</article>