wpPaginate (for WP 1.5)
I know this has been asked for some time. You can thank the snow storm we got here in the northeast, that made me stick around long enough to get it done.
I’ve updated my wpPaginate plugin to work with WP 1.5. I got a lot of inspiration from the Custom Posts Per Page plugin (and my plugin should work in conjunction with that one).
Current Version: v. .2.2
Last Updated: 1/25/04 9:30 PM EST
Download and install this plugin
(Same as always: right-click and save that file with a .php extension. Make sure you do not have any spaces before the first <?php or after the last ?> in your copy. These spaces will cause “cannot modify header…” type errors.
Instructions.
optional: adjust settings where noted in the plugin.
1) upload plugin file to your wp-content/plugins directory.
2) activate through admin control panel
3) where you want to show paginated navigation do the following:
<? print_pg_navigation() ?>
optional: you can pass two strings to print_pg_navigation. The first string is what will appear BEFORE the page navigation. The second string is what will appear AFTER the page navigation. NOTHING will be displayed if no navigation is appearing on the page. So, when there is navigation, if you wanted to have the navigation surrounded by <p> tags, you would do the following:
<? print_pg_navigation(’<p>’,'</p>’); ?>
Consider this basically a “beta” version. I’ve tested it on a test site, but that’s about it.
IMPORTANT UPGRADE INFORMATION:
If you still have the code from the original wpPaginate version - make sure you REMOVE the “wpPaginate()” function call in your templates/themes. You no longer need to call that function, and it will actually cause problems if you do.
Change Log
new in ver .2.2
bug fixes.
new in ver .2.1
lotsa little bug fixes. Also fixed some issues so it runs faster.
January 23rd, 2005 at 7:40 pm
HA, that’s fast! Thanks very much! Just asked about it a few days ago ;-). And all thanks to the rough weather (which I only saw on television).
It seems to work fine with my site too. I’m happy to have it back on my pages
http://www.spoenk.nl/weblog/?cat=5&paged=1
January 23rd, 2005 at 10:16 pm
Fixed some issues I noticed. Updated to v. .2.1
January 24th, 2005 at 8:40 am
That’s strange: v.2 of the plugin worked well, apart from on the category page where it would say “invalid argument supplied for foreach()” in the wp-includes/template-functions-category.php file, at the top of each category archive page.
In v.2.1 this message is gone, but the plugin doesn’t return anything! I haven’t changed any of the default settings within the plugin file.
Any ideas? Many thanks for your hard work, Jennifer.
January 24th, 2005 at 11:09 am
Huge thanks for this plugin! I was a great fan of the 1.2 version, and was very sorry to let it go when I updated to 1.5, so glad to see you’re focusing on 1.5 also now.
Unfortunately, I can’t get it to work. The problem seems the same as the above poster: pages work, but there’s no pagination-navigation.
January 24th, 2005 at 11:14 am
I’m working on the issue and will update the plugin when it’s ready.
January 25th, 2005 at 10:36 pm
Ok, give it another try. Updated to ver .2.2. Category error page should be gone. (and the rest of the functionality should be back too. heh)
January 26th, 2005 at 7:30 am
Great stuff! It looks like all the problems have been resolved…. many thanks.
January 26th, 2005 at 8:21 am
Jennifer,
It’s much better now, though still fairly buggy, specifically when it comes to WP 1.5 Themes and Pages.
What happens on my site (I’ve deactivated it again), is that on date archives, category archives and pages, the various functions described by Ryan Boren such as
is_page()oris_archive()seem to stop working. This concretely results in my sidebar (which is a template file) shows items that are not supposed to be on all pages.One example is “if (!is_archive()) { [show playlist] }”. Hope this helps, thanks for your work, and if you need more help, you can contact me.
January 26th, 2005 at 9:13 am
I tested it out using the (now) default Kubrik them. I’ll take a look at the specific functions you’re talking about, though.
January 27th, 2005 at 10:04 am
The fix to Joen’s problem: make sure you are not still calling the wpPaginate() function like you did in the previous wpPagainte plugin version. There’s no need to do that anymore (and will cause problems if you do). I’ll update the post to reflect that as well…
February 7th, 2005 at 6:07 pm
First of all I’d like to thank you for your work on this plugin it’s excellent. I’ve been using it in 1.2.2
However recently I’ve been converting to 1.5 02-07-05 built and I got everything worked out, got the new plugin version.
Yet for some reason the frontpage takes a really long time to load, archives, search, singles are all fine. When I turn off paginate it loads fine.
stable: 1.2.2
test site: 1.5
I’m simply trying to mimic what I have in 1.2.2 in 1.5
February 8th, 2005 at 8:47 am
Dmitri - I opened both those links at the same time (in different browser windows) - and they loaded in at the same time?? Is the plugin not running?
February 12th, 2005 at 9:26 am
Jennifer, thanks so much for writing this plugin. I was definitely missing the MTPaginate plugin with MT! I saw that you asked in the previous WPPaginate post if anyone would be interested in a “View All” function. I am definitely interested. Right now the code View All doesn’t quite work the way I thought it would. It doesn’t view posts for that particular category (I’m using WPPaginate for Category pagination).
Here is how my MT implementation makes use of the MTPaginate plug-in. Is this possible with WPPaginate?
http://www.asianmack.com/archives/cat_alternative.html
Again, any advice would be much appreciated. Thanks again!
February 13th, 2005 at 3:06 pm
Any chance of making something like this for comments? I have a post that is sitting at 93 comments and is likely to continually grow, so it’d be nice to split them up on a custom amount per page.
February 15th, 2005 at 11:28 am
Jennifer, I wanted to also followup on my tweaking of WPPaginate for my working WP installl. Here’s the same version of the category page with an early implementation of the WPPaginate plugin.
http://www.asianmack.com/wordpress/index.php?cat=2
February 15th, 2005 at 11:17 pm
I did not actually incorporate the “view all” functionality in the latest version… I will have to add it to the to do list. I’ll be honest though - between full time job and freelance work - I don’t have much time to do side projects like this these days. I wish I did…
February 16th, 2005 at 4:12 am
Just a quick suggestion for your page for this project. Some of us have never used the MT plug-in which apparently inspired this one. So, I have no idea what it actually does. Doesn’t WP 1.5 already have paging built-in? (Not the static pages, but paging through an article.) How is this different?
February 21st, 2005 at 10:12 am
Jennifer, great job on this plugin! was wondering though if it’s possible to make the pages only appear in the archives page and not on the index page itself.
February 21st, 2005 at 10:18 am
Not 100% sure what you’re asking - but if you’re referring to the pagination nav - look at the settings in the plugin file itself to edit which pages it will show up on.
February 21st, 2005 at 8:54 pm
Thanks for this plugin. Brill’!
February 24th, 2005 at 10:36 pm
word to the wise:
please remind to delete the old rules in your .htaccess file (if using clean urls in permalinks), or at least the ones refering to category pages.
when upgrading to 1.5, wordpress will add/append the new rules to your .htaccess but apache will match the url to your old category rule that doesn’t know anything about the new paged result sets…
March 17th, 2005 at 10:10 am
Hi Jennifer, thanks for the code.
However, when i navigate the last page at my weblog, i found out that it never shows all the posts. Any idea?
March 17th, 2005 at 10:27 am
Nevermind about my last post.
I found out that the problem is due to the conflicts between this plugin and the Category Visibility Plugin by Gudlyf’s World.
I have point out this at Gudlyf’s weblog.
March 17th, 2005 at 7:54 pm
Thanks for the plugin, its been helpful in the past. However, using the new version in WP 1.5, I often get more pages than I have posts for! For example, my March 05 archives have only 2 pages worth of posts, but I get links for 5 pages. This is also true if I use the page links on the home page. I get 32 page links, but only have about 20 something pages worth of posts.
What’s weird, is that not all archives and category pages have this problem. Some print the exact number of page links needed.
I’ve tried disabling all other plugins and changing back to the default themes/template, but I still get more page links than necessary.
Hope someone knows what’s going on.
March 17th, 2005 at 9:49 pm
Andrew - I’m going on vacation soon - but I’ll email you when I can. Since I had this working on a base WP install - I’m thinking it’s probably a plugin conflict. In the meantime, if you want to try turning on and off other plugins to narrow down which one it might (or if that’s the problem to begin with) that would get a jump on things….
April 20th, 2005 at 8:57 am
There seems to be a problem with the Paginate. For some reason it would show links that don’t exists. My entire site shows up to 90 pages but the paginate displays 112. Same goes for my archives, it displays more pages than actually exists.
Is there a fix to this?
April 23rd, 2005 at 8:32 am
very handy plugin
Just wondering if you have (or know of) a plugin that provides similar functionality for paginating long lists of comments within each post?
April 26th, 2005 at 4:40 am
Hello goddess, thank you very much for this simple functionality, but it works great on my side and let peope be aware there is much more to read.
April 26th, 2005 at 11:58 am
hello

this plugin is just what I was looking for. But I encountered a problem because the page that needs to be paginated is called news.php and not index.php.
And when one of the pagination number is clicked, the URL is: http://www.domain.it/news.php/index.php?paged=2 and it’s not correct. Can you help? Thanx
April 30th, 2005 at 11:28 pm
If you for some reason like me want a divider only between 2 page numbers, eg 1 … 2 | 3 | 4 … 10, change line 105
“if ($i != 1) {”
to
“if (($i > ($lowtest + 1) || $lowtest == 1) && ($i < ($hightest) || $hightest == $num_of_pages) && $i != 1 ) {”
May 3rd, 2005 at 5:00 am
solved
http://wordpress.org/support/topic/32474