-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
100 lines (73 loc) · 2.8 KB
/
single.php
File metadata and controls
100 lines (73 loc) · 2.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/**
* Template Name: Single
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*
* The template for displaying all single posts.
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
*/
get_header(); ?>
<div class="container clearfix">
<div id="primary" class="content-area">
<!-- section -->
<section>
<?php if ( have_posts() ) : while (have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', 'single' ); ?>
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- post thumbnail -->
<?php if ( has_post_thumbnail() ) : // Check if Thumbnail exists. ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); // Fullsize image for the single post. ?>
</a>
<?php endif; ?>
<!-- /post thumbnail -->
<!-- post title -->
<h1>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
</h1>
<!-- /post title -->
<!-- post details -->
<span class="date">
<time datetime="<?php the_time( 'Y-m-d' ); ?> <?php the_time( 'H:i' ); ?>">
<?php the_date(); ?> <?php the_time(); ?>
</time>
</span>
<span class="author"><?php esc_html_e( 'Published by', 'creativity' ); ?> <?php the_author_posts_link(); ?></span>
<span class="comments"><?php if ( comments_open( get_the_ID() ) ) comments_popup_link( __( 'Leave your thoughts', 'creativity' ), __( '1 Comment', 'creativity' ), __( '% Comments', 'creativity' ) ); ?></span>
<!-- /post details -->
<?php the_content(); // Dynamic Content. ?>
<?php the_tags( __( 'Tags: ', 'creativity' ), ', ', '<br>' ); // Separated by commas with a line break at the end. ?>
<p><?php esc_html_e( 'Categorised in: ', 'creativity' ); the_category( ', ' ); // Separated by commas. ?></p>
<p><?php esc_html_e( 'This post was written by ', 'creativity' ); the_author(); ?></p>
<?php edit_post_link(); // Always handy to have Edit Post Links available. ?>
<?php comments_template(); ?>
</article>
<!-- /article -->
<?php endwhile; ?>
<?php else : ?>
<!-- article -->
<article>
<h1><?php esc_html_e( 'Sorry, nothing to display.', 'creativity' ); ?></h1>
</article>
<!-- /article -->
<?php endif; ?>
</section>
<?php creativity_post_navigation(); ?>
<?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;
?>
<?php endwhile; // End of the loop. ?>
</div><!-- #primary -->
<?php get_sidebar('left'); ?>
<?php get_sidebar('right'); ?>
</div>
<?php get_footer();