-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsingle.php
More file actions
64 lines (52 loc) · 2.14 KB
/
single.php
File metadata and controls
64 lines (52 loc) · 2.14 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
<?php
/* Template that powers all single blog post pages. */
get_header();
$date_published = get_the_date();
$date_modified = get_the_modified_date();
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="jumbotron">
<div class="container">
<div class="row">
<div class="col-md-8">
<h1 class="page-title"><?php the_title(); ?></h1>
<ul class="list-inline post-meta">
<li><i class="fa-calendar"></i> <?php the_date(); ?></li>
<?php if ( $date_published != $date_modified ) { ?>
<li><i class="fa-clock-o"></i> Updated: <?php echo human_time_diff( get_the_modified_date('U'), current_time('timestamp') ) . ' ago'; ?></li>
<?php } // end if ?>
<li><i class="fa-comments"></i> <?php comments_popup_link('No Comments', '1 Comment', '% Comments', 'comments-link', ''); ?></li>
</ul>
<p><i class="fa-folder-open"></i> <?php the_category(', '); ?></p>
<?php if ( has_tag() ) { // Check if post has any tags ?>
<p><i class="fa-tags"></i> <?php the_tags('', ', '); ?></p>
<?php } // end if ?>
</div> <!-- .col-md-8 -->
<div class="col-md-4 img-featured">
<?php // Insert featured image
if (has_post_thumbnail()) {
echo get_the_post_thumbnail($post->ID, 'large', array('class' => 'img-responsive', 'title' => ''));
} else { // Use a fallback ?>
<img class="thumbnail" src="http://placehold.it/750x500" alt="Image coming soon" />
<?php } ?>
</div> <!-- .col-md-4 -->
</div> <!-- .row -->
</div> <!-- .container -->
</div> <!-- .jumbotron -->
<div class="container" id="main">
<div class="row">
<div class="col-md-8">
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php the_content(); ?>
<ul class="pager">
<li class="previous"><?php previous_post_link('%link', '<i class="fa-chevron-left"></i> %title'); ?></li>
<li class="next"><?php next_post_link('%link', '%title <i class="fa-chevron-right"></i>'); ?></li>
</ul>
</article>
<?php comments_template(); ?>
</div> <!-- .col-md-8 -->
<?php endwhile; endif; ?>
<?php get_sidebar(); ?>
</div> <!-- .row -->
</div> <!-- .container -->
<?php get_footer(); ?>