Category pagination fix – WordPress plugin
Update (07 December 2011) : An update has been made to the plugin and is available for download from WordPress plugins directory. This will fix pagination on custom post types as well.
Plugin name : Category pagination fix
Release date : 2009-04-25
Description
Fixes the bug in WordPress 2.7 ( may be in lower version also) in category listing page pagination. When you are using permalink structure as %category%/%postname% , second page URL of category listing page will be category-name/page/2 which WordPress identify “page” as post name. And will return 404 error page. This plug-in will fix the issue. This also fix the next and previous buttons bug in while using custom permalink structure.
I’m using this plug-in for this blog itself
Installation
1 . Unzip into your /wp-content/plugins/ directory.
2 . Activate the plugin through the ‘Plugins’ menu in WordPress
Known issues
No issues reported yet. Please report issues in comments
Download
Incoming search terms:
wordpress category pagination, custom post type category pagination fix, wordpress pagination not working category

Fix for the custom types:
Add this to functions.php
add_rewrite_rule("[posttype]" . '$', "index.php?pagename=[posttype]", "top"); add_rewrite_rule("[posttype]" . '/page/([0-9])*/?', "index.php?pagename=[posttype]" . '&paged=$matches[1]', "top"); global $wp_rewrite; $wp_rewrite->flush_rules();Change [posttype] to the name of your posttype.
Remiz,
I tried your plugin with the latest version of WP (3.2.1.) but I can’t seem to get it to work. It gives me additional pages but when I try and click beyond page 2 I end up with a 404 page, which is kind of weird since that second page is fully working… (like this – “x.com/news/page/2″). Could this have something to do with how the function calculates the number of pages, or is is something entirely else? Would really appreciate any help with this.
Im on 3.2.1 and it works fine. It seems not working fine if you are using Custom post types. Ill need some time to find a solution. At present Im busy with something else. Mostly some one might have already come up with a solution for this
I managed to solve it by setting “Blog pages show at most” to 1 in the admin panel, then overriding that setting in the actual queries if needed with “showposts=-1″.
I have a couple of sections where I want to display different amounts. For this in particular I just want to display 1 per page (I’m then using the Infinite Scroll jQuery plugin to reveal more articles beneath the first).
I’ve managed to get a solution for category paginatrion problems whe you alter the number of post per page. Take look here:
http://wordpress.org/support/topic/explanation-and-workaround-for-error-404-on-category-pagination?replies=3
Unfortunately, this did not work for me on WP 3.2.1. With (and without) the plugin installed, my pagination works on my general blog page; however the pagination breaks if you are viewing individual categories. Any ideas on how to fix this issue?
Cheers,
Brad
the problem persist, wuat a have to do?
helpe me please.
i have the same problem, i ever oploat end activated but the problem no fixed.
help please
You are great!!!!!
Awesome info once again! Thanks!
Same Problem here with WordPress 3.2 WP, “No Category Base” and “WP-PageNavi” plugins installed
I’m so disapointed, I was so close to the Perfect URL Structure for SEO
Can someone fix this?
It would be greatly appreciated
nvm my problem is fixed with putting /%slug%/%postname% instead of /%category%/%postname%
or maybe I did something else but now it Works
Awesome!!! Changing permalink structure like you wrote helped! Thank you.
Having the same problem with 3.2.1.
I tried changing to using /%slug%/%postname% which stopped the 404 & worked OK for categories, but the actual post URLs now include the actual text “%slug%” rather than the suitable replacement.
I think have solved this one though… if you change all references of “$query_string['name']” for “$query_string['pagename']” it seems to do the trick.
[...] is a category, you may be a victim of the ‘Category Pagination bug’. This plugin claims to be a fix. Related Articles:uptonpickman on "query_posts() and pagination on [...]
Hello,
I am using wp 3.1.1 and I set Permalink to /%postname%/.
Since some days to click to categories get to the 404 error.
If I click to the post itself, it works.
I tried many suggestions around the net (including rewriting of the .htaccess) but it doesn’t work.
I tried your plugin too and it doesn’t work…
Do you have perhaps some other idea ?
Thanks to help me.
Best regards
Fajy
I have the Bold theme by elegant themes and this fix didn’t work for me. Secondary pages still don’t appear. Please help.
Hi, thanks Remiz.
It’s possible that work fine in subcategories?
.
Cheers
Yes it works fine i think.
I’ve recently installed the plugin on my WP 3.0.4 site. I am still getting the 404 error on page 2 or above of my custom post type archive page. I don’t have any pages named the same as my post type so I’m not sure what else could be causing the issue.
Could you suggest any other solutions?
Thanks.
Paul
This plugin seems to have issue with Custom post types. I will try on it over free time. Let me know if you got it fixed. I will upload to wordpress plugin directory so that everyone can use it
It is not working for me.
I need to make a pagination for category page.
Please have a look into plugin and let me know if you can help me.
BOSS!! Thank YOU!
You’r welcome
It’s doesn’t work for me, I’m using wp3.01… nothing happend
This works great. Saved me a ton of time. Thanks so much.
How about pagination error in the posts. My category pagination is working fine, but I’m having problem with the post pagination. Our blog is located here – http://www.lamandier-maroc.com/blog. The next page link /blog/index.php/page/2 is returning 404. Have you had some issues regarding this before? It’s on WordPress 2.7 by the way.
Thanks!
Unable to use search function on pages.
Example:
/category/page/?s=search+terms&searchbtn=Go
If there are no results it will display the no results page.
If there are results it will just display the page you are on as if nothing happened. Might be related to this plug-in?
@ AJ
Will check in to this on weekend. Keep watching the space
Thanks for reporting
Hello, I’m still having troubles. I”m using 2.9.2, but the issue is still there.
I downloaded the plugin, put it in the /plugins directory, activated it, but I still get the 404 message.
Any help please?
Ill check in to it this Sunday
. Havent checked WP3 yet !
@Sam : You need to activate the plugin from the back-end. Have you done it? Let me know for help