Ticket #6513 (closed defect: fixed)

Opened 6 months ago

Last modified 2 months ago

Older/Newer Post error in classic Theme

Reported by: private_meta Assigned to: anonymous
Priority: low Milestone: 2.6
Component: Template Version: 2.5
Severity: minor Keywords: has-patch 2nd-opinion posts_nav_link classic
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

wp_theme_classic_index.diff (461 bytes) - added by private_meta on 03/31/08 20:08:08.
Classic Theme index.php patch
6513.diff (0.5 kB) - added by Otto42 on 04/07/08 21:17:55.
Fixed patch

Change History

03/31/08 20:08:08 changed by private_meta

  • attachment wp_theme_classic_index.diff added.

Classic Theme index.php patch

03/31/08 20:14:59 changed by lloydbudd

  • keywords changed from has-patch needs-testing to has-patch.
  • 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

(follow-up: ↓ 4 ) 04/04/08 10:01:38 changed by stevegk

  • keywords changed from has-patch to has-patch 2nd-opinion.

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.

04/07/08 21:17:41 changed by Otto42

  • 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.

04/07/08 21:17:55 changed by Otto42

  • attachment 6513.diff added.

Fixed patch

(in reply to: ↑ 2 ) 04/15/08 16:41:58 changed by Otto42

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.

04/17/08 12:31:10 changed by stevegk

Thanks for the explanation - it all makes sense now.

Patch works fine - tested on 2.5.

05/01/08 17:54:53 changed by filosofo

  • keywords changed from has-patch 2nd-opinion to has-patch 2nd-opinion posts_nav_link classic.

05/01/08 21:36:02 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [7869]) Classic theme navigation fix from Otto42. fixes #6513 for trunk

05/01/08 21:36:13 changed by ryan

(In [7870]) Classic theme navigation fix from Otto42. fixes #6513 for 2.5

07/15/08 16:24:07 changed by ryan

  • milestone changed from 2.5.2 to 2.9.

Milestone 2.5.2 deleted

07/30/08 20:27:06 changed by westi

  • milestone changed from 2.9 to 2.6.