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
|
<?php /** * Post navigation in single post * Create next and prev button to next and prev posts * * @since 1.0 */
if ( penci_get_setting( 'penci_hide_single_post_nav' ) ) { return; }
$thumb = penci_get_setting( 'penci_show_single_post_nav_thumbnail' );
$prev_post = get_previous_post(); $next_post = get_next_post(); ?> <?php if ( ! empty( $prev_post ) || ! empty( $next_post ) ) : ?> <div class="penci-post-pagination"> <?php if ( ! empty( $prev_post ) ) : ?> <div class="prev-post"> <?php if ( has_post_thumbnail( $prev_post->ID ) && $thumb ): ?> <div class="penci_media_object"> <a class="post-nav-thumb penci_mobj__img" href="<?php echo esc_url( get_the_permalink( $prev_post->ID ) ); ?>"> <?php echo wp_kses_post( get_the_post_thumbnail( $prev_post->ID, 'thumbnail' ) ); ?> </a> <?php endif; ?> <div class="prev-post-inner penci_mobj__body"> <div class="prev-post-title"> <span><i class="fa fa-angle-left"></i><?php echo esc_html( penci_get_tran_setting( 'penci_content_pre_text' ) ); ?></span> </div> <div class="pagi-text"> <h5 class="prev-title"><a href="<?php echo esc_url( get_the_permalink( $prev_post->ID ) ); ?>"><?php echo sanitize_text_field( get_the_title( $prev_post->ID ) ); ?></a></h5> </div> </div> <?php if ( has_post_thumbnail( $prev_post->ID ) && $thumb ): ?></div><?php endif; ?>
</div> <?php endif; ?>
<?php if ( ! empty( $next_post ) ) : ?> <div class="next-post "> <?php if ( has_post_thumbnail( $next_post->ID ) && $thumb ): ?> <div class="penci_media_object penci_mobj-image-right"> <a class="post-nav-thumb penci_mobj__img" href="<?php echo esc_url( get_the_permalink( $next_post->ID ) ); ?>"> <?php echo wp_kses_post( get_the_post_thumbnail( $next_post->ID, 'thumbnail' ) ); ?> </a> <?php endif; ?> <div class="next-post-inner"> <div class="prev-post-title next-post-title"> <span><?php echo esc_html( penci_get_tran_setting( 'penci_content_next_text' ) ); ?><i class="fa fa-angle-right"></i></span> </div> <div class="pagi-text"> <h5 class="next-title"><a href="<?php echo esc_url( get_the_permalink( $next_post->ID ) ); ?>"><?php echo sanitize_text_field( get_the_title( $next_post->ID ) ); ?></a></h5> </div> </div> <?php if ( has_post_thumbnail( $next_post->ID ) && $thumb ): ?></div><?php endif; ?> </div> <?php endif; ?> </div> <?php endif; ?>
|