{"id":42,"date":"2005-01-15T01:32:16","date_gmt":"2005-01-15T06:32:16","guid":{"rendered":"http:\/\/lee.org\/blog\/archives\/2005\/01\/15\/installed-page-navigation\/"},"modified":"2005-03-10T19:35:45","modified_gmt":"2005-03-11T00:35:45","slug":"installed-page-navigation","status":"publish","type":"post","link":"https:\/\/www.lee.org\/blog\/2005\/01\/15\/installed-page-navigation\/","title":{"rendered":"Installed Page Navigation"},"content":{"rendered":"<p>I just installed the Page Navigation Plugin, page-navi.php from <a href=\"http:\/\/www.lesterchan.net\/portfolio\/programming.php\">Lester Chan<\/a>. <\/p>\n<p>It lets me put a navigation bar on my site like this:<br \/>\n<code>Pages (6) :   Previous Page  1 [2] 3 4   Next Page   ... Last \u00bb<\/code><\/p>\n<p>It installed in about 5 minutes (and then of course I had to fiddle with it for 30 minutes&#8230;. but it installed very easily. And that&#8217;s very nice. :-)<\/p>\n<p>I made a slight improvement in 1.2 that you might want to integrate into the source.<\/p>\n<p>This starts at line 36. New code in red.\n<\/p>\n<p><code>$numposts = $wpdb-&gt;num_rows;<br \/>\n$max_page = ceil($numposts \/ $posts_per_page) ;<br \/>\n&nbsp; <br \/>\n<font color=\"#FF0000\">\/\/ Return added by LCS 1-15-05. This causes nothing to be displayed if there is only 1 page <br \/>\nif ($max_page == 1) { <br \/>\n&nbsp;&nbsp;&nbsp; return;<br \/>\n}<\/font><br \/>\n&nbsp;<br \/>\necho $before.'Pages ('.$max_page.') : &lt;b&gt;';<br \/>\nif ($whichpage &gt;= 4)<\/code><\/p>\n<p>Without this change, Page Navi is a little obtrusive when I put it in a prominent spot in Index.php and I&#8217;m displaying only 1 post&#8230; like when I&#8217;m viewing archives.<\/p>\n<hr \/>\n<p>3-10-05 update. This plugin doesn&#8217;t work with WP 1.5 so I&#8217;ve switched to another plugin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8230; Last \u00bb It installed in about 5 minutes (and then of course I had to fiddle with it for 30 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":0,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}