Skip to content

Twenty Twenty: fix "Older Posts" label for archive pages with respect to order#9082

Closed
shrivastavanolo wants to merge 3 commits intoWordPress:trunkfrom
shrivastavanolo:fix/archive-page-nav-labels-twentytwenty
Closed

Twenty Twenty: fix "Older Posts" label for archive pages with respect to order#9082
shrivastavanolo wants to merge 3 commits intoWordPress:trunkfrom
shrivastavanolo:fix/archive-page-nav-labels-twentytwenty

Conversation

@shrivastavanolo
Copy link
Copy Markdown

@shrivastavanolo shrivastavanolo commented Jun 26, 2025

Similar to PR
Fixes the issue: "Older Entries" and "Newer Entries" links are wrong when entries displayed in ascending order for the Twenty Twenty theme by adding dynamic labels according to the order query var (DESC or ASC). More info in the trac ticket.

Trac ticket: https://core.trac.wordpress.org/ticket/10219


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 26, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props shreya0shrivastava, joedolson, sirlouen, sabernhardt, shailu25.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Copy Markdown

@sabernhardt sabernhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

In default (descending) order, the navigation appears the same as it did before the patch. The screenshots show the theme's :focus underline and Firefox's :focus-visible outline for the first link in page navigation (DOM order), and I checked English and French.

with patch, descending order, English with patch, descending order, French

With ?order=ASC, the labels switch accordingly.

with patch, ascending order, English with patch, ascending order, French

On smaller screens, it still hides "posts":
with patch, ascending order, English, narrow viewport


Full-page screenshots show three posts, with different published dates (matching the chapter number to the day of the month).

A diff shows the text changes for the ASC page, before and after applying the patch, within the markup:

 	<nav class="navigation pagination" aria-label="Posts pagination">
 		<h2 class="screen-reader-text">Posts pagination</h2>
-		<div class="nav-links"><a class="prev page-numbers" href="http://localhost/svn/src/tag/alice/?order=ASC"><span aria-hidden="true">&larr;</span> <span class="nav-prev-text">Newer <span class="nav-short">Posts</span></span></a>
+		<div class="nav-links"><a class="prev page-numbers" href="http://localhost/svn/src/tag/alice/?order=ASC"><span aria-hidden="true">&larr;</span> <span class="nav-prev-text">Older <span class="nav-short">Posts</span></span></a>
 <a class="page-numbers" href="http://localhost/svn/src/tag/alice/?order=ASC">1</a>
 <span aria-current="page" class="page-numbers current">2</span>
 <a class="page-numbers" href="http://localhost/svn/src/tag/alice/page/3/?order=ASC">3</a>
 <a class="page-numbers" href="http://localhost/svn/src/tag/alice/page/4/?order=ASC">4</a>
-<a class="next page-numbers" href="http://localhost/svn/src/tag/alice/page/3/?order=ASC"><span class="nav-next-text">Older <span class="nav-short">Posts</span></span> <span aria-hidden="true">&rarr;</span></a></div>
+<a class="next page-numbers" href="http://localhost/svn/src/tag/alice/page/3/?order=ASC"><span class="nav-next-text">Newer <span class="nav-short">Posts</span></span> <span aria-hidden="true">&rarr;</span></a></div>
 	</nav>

@shail-mehta
Copy link
Copy Markdown
Member

Before After
twenty-twenty-before twenty-twenty-after

@github-actions
Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 61097
GitHub commit: d8df46a

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants