Opened 4 years ago
Last modified 3 years ago
#9324 accepted defect (bug)
Let wp_link_pages do pagination when static page is used for front page
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Template | Version: | 3.0 |
| Severity: | major | Keywords: | needs-patch |
| Cc: | sorich87@… |
Description
Mentioned on WP-Hackers. If a static paginated page is used for the front page and wp_link_pages is used in the theme, the pagination links will return 404 because get_permalink will return the front page URL as the root of paginated links. I marked it as a bug since it can cause 404 errors if you don't know about it.
The enclosed patch tests for is_front_page and static pages using alternate _get_page_link functions for paginated content and using get_permalink for standard paginated links. It even works when a child page is set for the front page.
This was a quick patch from a custom function, so it could probably be written a little better.
Attachments (3)
Change History (15)
ev3rywh3re — 4 years ago
- Keywords needs-patch added; wp_link_pages has-patch needs-testing removed
-1 to the patch. we should fix the 404 error that is spit by the query parser instead.
- Keywords has-patch tested added; needs-patch removed
mm, looked a bit deeper into this, and the issue is a bit trickier in fact. based on the rewrite rules, the same issue is also valid for feeds.
on a static front page, the site.com/feed is that of the site (as it should), rather than for that page. so this should be fixed as well, and +1 to the patch's approach.
confirming that the patch fixes the issue.
and the static front page's comments feed url should get the same treatment.
Denis-de-Bernardy — 4 years ago
- Keywords commit added
- Severity changed from normal to major
updated patch combines ev3rywh3re's patch and the fix to the single_feed() function
- Owner changed from anonymous to Denis-de-Bernardy
- Status changed from new to accepted
- Keywords early added
- Milestone changed from 2.8 to 2.9
can wait a little longer, even if the patch works.
still applies clean
- Owner Denis-de-Bernardy deleted
- Status changed from accepted to assigned
- Keywords needs-patch added; has-patch tested commit early removed
borke patch
comment:10
nacin — 3 years ago
- Keywords needs-refresh added; needs-patch removed
comment:11
sorich87 — 3 years ago
- Cc sorich87@… added
- Keywords has-patch added; needs-refresh removed
- Owner set to sorich87
- Status changed from assigned to accepted
- Version changed from 2.8 to 3.0

Updated wp_link_pages for paginated front page