Make WordPress Core

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's profile ev3rywh3re Owned by: sorich87's profile 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)

wp_link_pages-r10773.diff (3.4 KB) - added by ev3rywh3re 15 years ago.
Updated wp_link_pages for paginated front page
9324.diff (4.1 KB) - added by Denis-de-Bernardy 15 years ago.
link-template.patch (2.8 KB) - added by sorich87 14 years ago.
patch updated for 3.0

Download all attachments as: .zip

Change History (17)

@ev3rywh3re
15 years ago

Updated wp_link_pages for paginated front page

#1 @Denis-de-Bernardy
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 @Denis-de-Bernardy
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 @Denis-de-Bernardy
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 @Denis-de-Bernardy
15 years ago

  • Owner changed from anonymous to Denis-de-Bernardy
  • Status changed from new to accepted

#5 @Denis-de-Bernardy
15 years ago

  • Keywords early added
  • Milestone changed from 2.8 to 2.9

can wait a little longer, even if the patch works.

#6 @Denis-de-Bernardy
15 years ago

still applies clean

#7 @Denis-de-Bernardy
15 years ago

  • Owner Denis-de-Bernardy deleted
  • Status changed from accepted to assigned

#8 @ryan
14 years ago

  • Milestone changed from 2.9 to Future Release

#9 @Denis-de-Bernardy
14 years ago

  • Keywords needs-patch added; has-patch tested commit early removed

borke patch

#10 @nacin
14 years ago

  • Keywords needs-refresh added; needs-patch removed

@sorich87
14 years ago

patch updated for 3.0

#11 @sorich87
14 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

#12 @hakre
13 years ago

  • Keywords needs-patch added; has-patch removed

Patch is broken.

#13 @nacin
10 years ago

  • Component changed from Template to Posts, Post Types
  • Focuses template added

#14 @obenland
10 years ago

  • Keywords needs-patch removed
  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from accepted to closed

This was fixed in #12391 and #12452.

Note: See TracTickets for help on using tickets.