Opened 4 years ago
Last modified 4 months ago
#8905 reopened defect (bug)
Category pagination broken with certain permalink structures
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Permalinks | Version: | 2.7 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | jsherk |
Description
If one uses a permalink structure with %category% followed by %postname%, accessing pagination can cause a 404, as WordPress attempts to look for a post called "page".
As per http://barefootdevelopment.blogspot.com/2007/11/fix-for-wordpress-paging-problem.html
Presumably can occur with other permalink structures too.
Change History (11)
- Keywords needs-patch added
- Milestone changed from 2.8 to Future Release
- Milestone changed from Future Release to 2.9
Ran into this issue today - would love to see a fix.
I'm not sure if it is as simple as putting some extra logic in parse_request()? Using Doug Smith's code as inspiration, I added the following right before $this->query_vars = apply_filters('request', $this->query_vars); :
if ($this->query_vars['name'] === 'page' && isset($this->query_vars['page'])) {
unset($this->query_vars['name']);
$this->query_vars['paged'] = str_replace('/', '', $this->query_vars['page']);
}
Thoughts?
comment:7
SergeyBiryukov — 10 months ago
Related: #21209
comment:8
wonderboymusic — 7 months ago
- Keywords needs-patch removed
- Milestone Future Release deleted
- Resolution set to worksforme
- Status changed from new to closed
http://wordpress-core/uncategorized/test-post-goes-here-this-is-some-more/2/ totally works for me when using <!--nextpage--> and navigating to page 2
Pretty sure this was fixed when some of the permalink stuff was redone.
comment:10
SergeyBiryukov — 7 months ago
- Keywords needs-patch added
- Milestone set to Future Release
- Resolution worksforme deleted
- Status changed from closed to reopened
This ticket is about category pagination, not single post pagination.
As noted in #21209, the issue still can be reproduced with bare category slugs:
- Set permalink structure to /%category%/%postname%/.
- http://mysite/mycat/page/2 gives a 404 error.
Debug Bar info:
Request: mycat/page/2 Query String: page=%2F2&name=page&category_name=mycat Matched Rewrite Rule: (.+?)/([^/]+)(/[0-9]+)?/?$ Matched Rewrite Query: category_name=mycat&name=page&page=%2F2
comment:11
SergeyBiryukov — 4 months ago
#23111 was marked as a duplicate.

punting