Repository navigation
Expand file tree
/
Copy pathcontent-single.php
More file actions
42 lines (42 loc) · 1.54 KB
/
Copy pathcontent-single.php
File metadata and controls
42 lines (42 loc) · 1.54 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
<div id="Content">
<?php setPostViews(get_the_ID()); ?>
<div id="Single-Post">
<h1><?php the_title(); ?></h1>
<div class="Entry-Meta">
<span class="DateTime"><?php the_time('d M Y') ?></span>
<span class="View"><i class="fa fa-eye"></i><?php echo getPostViews(get_the_ID()); ?></span>
</div>
<div class="Tags">
<span><?php the_tags('<ul><li>', '</li><li>', '</li></ul>'); ?></span>
</div>
<?php
if (has_post_thumbnail()) {
echo '<div class="Featured-Image">';
the_post_thumbnail();
echo '</div>';
}
?>
<div class="Post-Content">
<?php
if (have_posts()) :
while (have_posts()) : the_post();
the_content();
endwhile;
endif;
?>
</div>
<?php
$related = get_posts(array('category__in' => wp_get_post_categories($post->ID), 'numberposts' => 5, 'post__not_in' => array($post->ID)));
if ($related) foreach ($related as $post) {
setup_postdata($post); ?>
<div class="Related-Post">
<h3>Related Post</h3>
<ul>
<li><span><?php the_time('d M Y') ?></span> » <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
</ul>
</div>
<?php
}
wp_reset_postdata(); ?>
<!-- <?php comments_template(); ?> -->
</div>