Opened 15 years ago
Closed 10 years ago
#9324 closed defect (bug) (invalid)
Let wp_link_pages do pagination when static page is used for front page
Reported by: | ev3rywh3re | Owned by: | sorich87 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 3.0 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | template | Cc: |
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 (17)
#1
@
15 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.
#2
@
15 years ago
- 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.
#3
@
15 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
#4
@
15 years ago
- Owner changed from anonymous to Denis-de-Bernardy
- Status changed from new to accepted
#5
@
15 years ago
- Keywords early added
- Milestone changed from 2.8 to 2.9
can wait a little longer, even if the patch works.
Updated wp_link_pages for paginated front page