Let wp_link_pages do pagination when static page is used for front page
|Reported by:||ev3rywh3re||Owned by:||sorich87|
|Component:||Posts, Post Types||Keywords:||needs-patch|
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.
Change History (16)
- Keywords needs-patch added; wp_link_pages has-patch needs-testing removed
- Keywords commit added
- Severity changed from normal to major
- Owner changed from anonymous to Denis-de-Bernardy
- Status changed from new to accepted
- Owner Denis-de-Bernardy deleted
- Status changed from accepted to assigned
- Keywords needs-patch added; has-patch tested commit early removed
comment:11 sorich87 — 4 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