Installed Page Navigation

I just installed the Page Navigation Plugin, page-navi.php from Lester Chan.

It lets me put a navigation bar on my site like this:
Pages (6) : Previous Page 1 [2] 3 4 Next Page ... Last »

It installed in about 5 minutes (and then of course I had to fiddle with it for 30 minutes…. but it installed very easily. And that’s very nice. :-)

I made a slight improvement in 1.2 that you might want to integrate into the source.

This starts at line 36. New code in red.

$numposts = $wpdb->num_rows;
$max_page = ceil($numposts / $posts_per_page) ;
// Return added by LCS 1-15-05. This causes nothing to be displayed if there is only 1 page
if ($max_page == 1) {

echo $before.'Pages ('.$max_page.') : <b>';
if ($whichpage >= 4)

Without this change, Page Navi is a little obtrusive when I put it in a prominent spot in Index.php and I’m displaying only 1 post… like when I’m viewing archives.

3-10-05 update. This plugin doesn’t work with WP 1.5 so I’ve switched to another plugin.


  1. Mac says:

    Which one would the other plugin be? I can’t seem to get Lester’s plugin to work, so I’m interested to hear what alternative you made. Thnxx.

Leave a Comment

Do not write "http://" or "https://" in your comment, it will be blocked. It may take a few days for me to manually approve your first comment.