-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpagination.php
More file actions
53 lines (42 loc) · 1.6 KB
/
pagination.php
File metadata and controls
53 lines (42 loc) · 1.6 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
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
<?php
/**
* The template for providing pagination throughout the theme.
*
* @package Archetype
* @version 1.0
* @since 1.0
*/
?>
<?php global $wp_query; ?>
<?php if( is_single() && 'post' == get_post_type() ) { ?>
<div id="single-post-nav">
<ul class="pager">
<?php $trunc_limit = 30; ?>
<?php if( '' != get_previous_post() ) { ?>
<li class="previous">
<?php previous_post_link( '<span class="previous-page">%link</span>', __( '<i class="fa fa-chevron-left"></i>', 'archetype' ) . ' ' . get_previous_post()->post_title ); ?>
</li>
<?php } // end if ?>
<?php if( '' != get_next_post() ) { ?>
<li class="next">
<?php next_post_link( '<span class="no-previous-page-link next-page">%link</span>', ' ' . get_next_post()->post_title . __( '<i class="fa fa-chevron-right"></i>', 'archetype' ) ); ?>
</li>
<?php } // end if ?>
</ul>
</div><!-- /#single-post-nav -->
<?php } elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) { ?>
<div id="post-nav">
<ul class="pager">
<?php if( get_next_posts_link() ) { ?>
<li class="previous">
<?php next_posts_link( __( '<span class="nav-previous meta-nav"><i class="fa fa-chevron-left"></i> Older</span>', 'archetype' ) ); ?>
</li>
<?php } // end if ?>
<?php if( get_previous_posts_link() ) { ?>
<li class="next">
<?php previous_posts_link( __( '<span class="nav-next meta-nav">Newer <i class="fa fa-chevron-right"></i></span>', 'archetype' ) ); ?>
</li>
<?php } // end if ?>
</ul><!-- /.pager -->
</div><!-- /#post-nav -->
<?php } // end if/else ?>