-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetail_post_navigation.php
52 lines (52 loc) · 2.04 KB
/
detail_post_navigation.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
<div class="ui single-nav">
<?php
$next_post = get_next_post();
$previous_post = get_previous_post();
?>
<?php if(is_a( $previous_post , 'WP_Post' )): ?>
<div class="ui card single-nav-left">
<div class="image">
<img src="<?php echo get_the_post_thumbnail_url($previous_post->ID, "next_post_thumbnail") ?>">
<button class="ui button single-nav-button-left">
<a href="<?php echo the_permalink($previous_post); ?>"><i class="angle left icon"></i>上一篇</a>
</button>
</div>
<div class="content">
<div class="title">
<a href="<?php echo the_permalink($previous_post); ?>">
<?php echo get_the_title($previous_post); ?>
</a>
</div>
<div class="description">
<a href="<?php echo the_permalink($previous_post) ?>">
<?php echo get_the_excerpt($previous_post->ID); ?>
</a>
</div>
</div>
</div>
<?php endif; ?>
<?php if(is_a( $next_post , 'WP_Post' )): ?>
<div class="ui card single-nav-right">
<div class="image">
<img src="<?php echo get_the_post_thumbnail_url($next_post->ID, "next_post_thumbnil") ?>">
<button class="ui button single-nav-button-right">
<a href="<?php echo the_permalink($next_post) ?>">
下一篇
<i class="angle right icon"></i></a>
</button>
</div>
<div class="content">
<div class="title">
<a href="<?php echo the_permalink($next_post) ?>">
<?php echo get_the_title($next_post); ?>
</a>
</div>
<div class="description">
<a href="<?php echo the_permalink($next_post) ?>">
<?php echo get_the_excerpt($next_post->ID); ?>
</a>
</div>
</div>
</div>
<?php endif; ?>
</div>