-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathloop-nav.php
More file actions
executable file
·28 lines (21 loc) · 1.09 KB
/
loop-nav.php
File metadata and controls
executable file
·28 lines (21 loc) · 1.09 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
<?php if ( is_singular( 'post' ) ) : // If viewing a single post page. ?>
<div class="loop-nav">
<?php previous_post_link( '<div class="prev">' . __( 'Previous: %link', 'silvia' ) . '</div>', '%title' ); ?>
<?php next_post_link( '<div class="next">' . __( 'Next: %link', 'silvia' ) . '</div>', '%title' ); ?>
</div><!-- .loop-nav -->
<?php elseif ( is_attachment() && wp_attachment_is_image() ) : // If viewing the attachment page. ?>
<div class="loop-nav">
<div class="prev"><?php previous_image_link( false, __( '« Previous Image', 'silvia' ) ); ?></div>
<div class="next"><?php next_image_link( false, __( 'Next Image »', 'silvia' ) ); ?></div>
</div><!-- .loop-nav -->
<?php elseif ( is_home() || is_archive() || is_search() ) : // If viewing the blog, an archive, or search results. ?>
<?php
/**
* Hide posts navigation if Jetpack infinite scroll module activated.
*/
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'infinite-scroll' ) ) {
return;
}
?>
<?php the_posts_pagination(); ?>
<?php endif; // End check for type of page being viewed. ?>