WordPress Simple Numbered Pagination Without a Plugin

Just place this WordPlace code snippet into a search of archive template.

I see a lot of wordpress sites use plugins and blouted php code to create simple pagination. This useful snippet is actually in the WordPress Codex, It seems alot of people do not know about it.


<?php
global $wp_query;

$big = 999999999; // need an unlikely integer

echo paginate_links( array(
	'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
	'format' => '?paged=%#%',
	'current' => max( 1, get_query_var('paged') ),
	'total' => $wp_query->max_num_pages
) );
?>