Created
April 21, 2014 05:33
-
-
Save alexmangini/11133172 to your computer and use it in GitHub Desktop.
Pagination for CPTs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Pagination ?> | |
<?php | |
$big = 999999999; | |
$total = $kolfolio->max_num_pages; | |
$paginate = paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var( 'paged' ) ), | |
'prev_text' => __( '← Previous', 'kol' ), | |
'next_text' => __( 'Next →', 'kol' ), | |
'total' => $total | |
) ); | |
?> | |
<?php if ( $paginate ) : ?> | |
<div class="pagination"> | |
<span class="pagination-total"><?php echo sprintf( __( 'Page %d of %2d', 'kol' ), $paged, $total ); ?></span> | |
<?php echo $paginate; ?> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment