-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
67 lines (51 loc) · 1.6 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
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
<?php
/**
* The template for displaying all single posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package Lance
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) : the_post();
$prevPost = get_previous_post();
$prevThumbnail = get_the_post_thumbnail( $prevPost->ID, 'project-thumb');
$prevTitle = get_the_title($prevPost->ID);
$nextPost = get_next_post();
$nextThumbnail = get_the_post_thumbnail( $nextPost->ID, 'project-thumb');
$nextTitle = get_the_title($nextPost->ID);
get_template_part( 'template-parts/content', get_post_format() );
?>
<?php endwhile; // End of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<div class="project-nav">
<div class="p-nav">
<div class="p-box">
<?php if ($prevPost) : ?>
<h5 class="p-post">Previous:</h5>
<?endif;?>
<?php
previous_post_link( '%link', '<span class="p-button">' . $prevThumbnail . '<h4 class="p-title">' . $prevTitle . '</h4></span>' ); ?>
</div> <!-- p-box -->
</div> <!-- p-nav -->
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="b-back-to-all">
Back To All
</a>
<div class="n-nav">
<div class="n-box">
<?php if ($nextPost) : ?>
<h5 class="n-post">Next:</h5>
<? endif; ?>
<?php
next_post_link( '%link', '<span class="n-button">' . $nextThumbnail . '<h4 class="n-title">' . $nextTitle . '</h4></span>' );
?>
</div>
</div>
</div> <!-- .project-nav -->
<?php
get_sidebar();
get_footer();