#6513 closed defect (bug) (fixed)
Older/Newer Post error in classic Theme
Reported by: | private_meta | Owned by: | |
---|---|---|---|
Milestone: | 2.6 | Priority: | low |
Severity: | minor | Version: | 2.5 |
Component: | Template | Keywords: | has-patch 2nd-opinion posts_nav_link classic |
Focuses: | Cc: |
Description
The classic theme, when spanning over several pages, has the link texts "Older Entries" and "Newer Entries" switched around, being on the first page, going back in time you have to click on "Newer Entries". I attached a
Attachments (2)
Change History (12)
#1
@
16 years ago
- Keywords needs-testing removed
- Milestone changed from 2.6 to 2.5.1
Confirmed bug and fix.
This is correct on WordPress.com
http://svn.automattic.com/wpcom-themes/classic/index.php
#2
follow-up:
↓ 4
@
16 years ago
- Keywords 2nd-opinion added
The above patch makes the links return the correct posts for the wording on the link, but where there are enough post for both previous and next links to be displayed they are not in a logical (chronological) order.
Newer Posts » — « Older Posts
Reading the codex entry http://codex.wordpress.org/Next_and_Previous_Links the patch also goes against the documentation. It seems that the function is returning next results when it should return previous results and vice versa.
Tested against 2.3.3.
#3
@
16 years ago
- Component changed from General to Template
Patch is pointing arrows inwards strangely. Attaching new patch, which is more in line with wordpress.com svn as given above.
#4
in reply to:
↑ 2
@
16 years ago
Replying to stevegk:
Reading the codex entry http://codex.wordpress.org/Next_and_Previous_Links the patch also goes against the documentation. It seems that the function is returning next results when it should return previous results and vice versa.
No, the codex was just wrong/confusing. I fixed it.
Basically, the problem is that "previous" and "next" are not referring to chronological time, they are referring to pages and post ordering.
Post ordering is arbitrary. It defaults to "post_date DESC", but it can be anything, really. If you change the query_posts to put it in ASC ordering, then the oldest post will show up first, and the previous/next links won't change. Oh, they'll point to different posts, but they'll still point to the previous/next posts in the given ordering.
"Next" refers to the next post in the given ordering, whatever it may be. By default, "next" = "older posts". This is admittedly confusing if you think of next as forward in time, but it is actually forward in the returned set of posts from the database, whatever order they may be in.
#5
@
16 years ago
Thanks for the explanation - it all makes sense now.
Patch works fine - tested on 2.5.
Classic Theme index.php patch