-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.php
57 lines (35 loc) · 1.22 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
<article class="post <?php if ( has_post_thumbnail() ) { ?>has-thumbnail <?php } ?>">
<!-- post-thumbnail -->
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('small-thumbnail'); ?></a>
</div><!-- /post-thumbnail -->
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></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 if ( is_search() OR is_archive() ) { ?>
<p>
<?php echo get_the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">Read more»</a>
</p>
<?php } else {
if ($post->post_excerpt) { ?>
<p>
<?php echo get_the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">Read more»</a>
</p>
<?php } else {
the_content();
}
} ?>
</article>