Numbered Pagination on wordpress
paste in function.php
global $wpquery;
$big = 12345678;
$pageformat = paginatelinks( array(
'base' => strreplace( $big, '%#%', escurl( getpagenumlink( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, getqueryvar('paged') ),
'total' => $wpquery->maxnumpages,
'type' => 'array'
) );
if( isarray($pageformat) ) {
$paged = ( getqueryvar('paged') == 0 ) ? 1 : getqueryvar('paged');
echo '<div><ul>';
echo '<li><span>'. $paged . ' of ' . $wpquery->maxnumpages .'</span></li>';
foreach ($pageformat as $page) {
echo "<li>$page</li>";
}
echo '</ul<</div<';
}
}
</code></pre>
paste in template file
<div class="pagination"><?php wp_pagination(); ?></div>
</code></pre>
Written by Rajesh Khatri
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Wordpress
Authors
Related Tags
#wordpress
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#