Opened 15 years ago
Last modified 6 years ago
#10219 new enhancement
"Older Entries" and "Newer Entries" links are wrong when entries displayed in ascending order
Reported by: | jikamens | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | needs-testing has-patch |
Focuses: | template | Cc: |
Description
I added "?order=ASC" to a tag URL I was sending out to some people, because I wanted them to view a set of blog postings in ascending chronological order, and I noticed that the "Older Entries" and "Newer Entries" links at the bottom of the page were reversed.
I fixed this with the attached changes to the default theme. I don't know if this is the "right" fix, but it worked for me, and if it isn't quite wrong, perhaps at least it will give a more experienced WordPress developer than I an idea for how to fix it properly.
Attachments (3)
Change History (12)
#1
@
15 years ago
- Component changed from General to Template
- Keywords needs-patch added
- Milestone changed from Unassigned to 2.9
- Priority changed from normal to low
- Severity changed from normal to minor
the functions should be fixed, rather.
#3
@
15 years ago
The functions should probably swap behavior when order is swapped.
Closed #10219 as a duplicate.
#4
@
15 years ago
- Milestone changed from 3.0 to Future Release
- Type changed from defect (bug) to enhancement
#6
@
9 years ago
- Keywords needs-testing added
- Priority changed from low to normal
- Severity changed from minor to normal
#7
@
9 years ago
For these reasons I believe this should be closed:
- The issue here isn't a matter of the get_* functions passing invalid urls, it's a matter of a theme's use of the label arg previous_/next_posts_link() and popular disregard for an
order
query param. - The default labels for these functions' nomenclature is correct since it uses
Next Page »
and« Previous Page
, instead of the Older/Newer.
However, I'm assuming we want to fix this issue with older core themes (pre-twenty-thirteen), which IMO is a superfluous, I'll work on those patches now.
#8
@
9 years ago
Since @chriscct7 punted this for @nacin to review I'm going to make this easier to understand just in case the circular logic is causing a misunderstanding.
Note: this example is using twenty thirteen...
The "older/newer" terminology isn't correct for obvious reasons, this isn't because the function is using the wrong terminology based on ascending order being used, it's because the labels being passed to the functions are incorrectly set.
This shows that without the labels being sent that the functions return the correct labels.
So, it's not a matter of switching the labels to something dependent on the sort order, it's a matter of the labels these older themes are using.
I can patch these older themes and I'll likely just do it since I'm now invested in this ticket (since my plan was to move on to another here at Contributor Day).
@
9 years ago
Minor mods of previous patch, along with additional support of twenty-twelve and twenty-eleven.
#9
@
9 years ago
- Keywords has-patch added; needs-patch removed
Marking this as having a patch; "needs-testing" can be removed because unit tests can't be written for this type of bug (AFAIK), instead I tested the themes patched. I've attached images of each theme below to show that we don't need to worry about the order of these links/elements (i.e. since "Older posts" link could be after "Newer posts" in the markup) and the CSS floating the elements improperly/non-aligned.
patch to to switch the links when displaying in ascending order