Created
January 9, 2012 09:21
-
-
Save ahmednuaman/1582149 to your computer and use it in GitHub Desktop.
Pagination for query_posts
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
$m = $wp_query->max_num_pages; | |
if ( $m > 1 ) | |
{ | |
?> | |
<div class="pagination"> | |
<ul> | |
<?php for ( $i = 1; $i <= $m; $i++ ): ?> | |
<li> | |
<a href="<?php the_permalink(); ?>/page/<?php echo $i; ?>" title="Go to page <?php echo $i; ?>"> | |
<span> | |
Page <?php echo $i; ?> | |
</span> | |
</a> | |
</li> | |
<?php endfor; ?> | |
</ul> | |
</div> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment