forked from Heydon/typical-theme-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop-single.php
73 lines (63 loc) · 2.11 KB
/
loop-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
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
<?php
/**
* The loop that displays a single post.
*
* @package WordPress
* @subpackage Typical
*/
?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<nav class="prev-and-next">
<h1>Previous And Next Post Navigation</h1>
<?php
$prev_post = get_previous_post();
if($prev_post) {
$prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
echo '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '"><span aria-hidden="true">←</span> Previous Post</a> ';
} else {
echo '<a rel="prev" href="#no"><span aria-hidden="true">←</span> Previous Post</a>';
}
$next_post = get_next_post();
if($next_post) {
$next_title = strip_tags(str_replace('"', '', $next_post->post_title));
echo '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '">Next Post <span aria-hidden="true">→</span></a> ';
} else {
echo '<a rel="next" href="#no">Next Post <span aria-hidden="true">→</span></a>';
}
?>
</nav>
<div itemscope itemtype="http://schema.org/Article">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<h1 itemprop="headline"><?php the_title(); ?></h1>
<div>
<?php typical_posted_on(); ?>
</div>
</header>
<?php
if ( has_post_thumbnail() ) {
typical_post_thumb_figure();
}
?>
<div itemprop="articleBody">
<?php the_content(); ?>
</div>
<?php wp_link_pages( array( 'before' => '<nav>' . __( 'Pages:', 'typical' ), 'after' => '</nav>' ) ); ?>
<footer>
<p>
<?php typical_posted_in(); ?>
<?php edit_post_link( __( 'Edit', 'typical' ), '', '' ); ?>
</p>
</footer>
<div aria-hidden="true"></div>
<?php
if ( get_the_author_meta( 'description' ) ) :
typical_author_info();
endif;
?>
</article>
<section id="comments" itemscope itemtype="http://schema.org/UserComments">
<?php comments_template( '', true ); ?>
</section>
</div>
<?php endwhile; // end of the loop. ?>