Skip to content

Instantly share code, notes, and snippets.

@fovoc
Created February 7, 2014 19:55
Show Gist options
  • Save fovoc/8870513 to your computer and use it in GitHub Desktop.
Save fovoc/8870513 to your computer and use it in GitHub Desktop.
<?php
if ( $pagination == 'pager' ) :
if ($wp_query->max_num_pages > 1) :
$current_page = max(1, get_query_var('paged'));
?>
<nav class="post-nav">
<ul class="pager">
<li class="previous"><?php next_posts_link(__('&larr; Older posts', 'roots')); ?></li>
<li class="text-center"><?php echo $current_page.' of '.$wp_query->max_num_pages; ?></li>
<li class="next"><?php previous_posts_link(__('Newer posts &rarr;', 'roots')); ?></li>
</ul>
</nav>
<?php
endif;
else :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment