-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
40 lines (28 loc) · 1.01 KB
/
single.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
<?php get_header() ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post();
$category = get_the_category();
if ($category) {
$cat_name = $category[0]->name;
$cat_term_id = $category[0]->term_id;
}
?>
<div class="container">
<div class="row">
<article class="postcontent col-lg-offset-2 col-lg-8">
<p class="margin-top-30 single-meta"><a class="boxed" href="<?php echo get_category_link($cat_term_id); ?>"><?= $cat_name ?></a> <?php echo get_the_date() ?></p>
<h1 class="page-heading"><?php echo single_post_title(); ?></h1>
<p class="single-meta">by <?php the_author(); ?></p>
<p class="single-meta margin-bottom-30"><?php the_author_meta('description'); ?></p>
<?php the_content() ?>
</article>
<?php // If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
</div>
</div>
<?php endwhile ?>
<?php endif ?>
<?php get_footer() ?>