Skip to content

Fix ambiguous link texts by removing redundant post date links and adding screen reader text to comments CTA - #93

Open
noruzzamans wants to merge 3 commits into
WordPress:trunkfrom
noruzzamans:fix/accessible-link-names
Open

noruzzamans wants to merge 3 commits into
WordPress:trunkfrom
noruzzamans:fix/accessible-link-names

Conversation

@noruzzamans

@noruzzamans noruzzamans commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #47

As identified in #47 during accessibility-ready verification for the theme, multiple links across post query loops lacked unique accessible names:

  1. Redundant Post Date Links: On index, archive, search, and single patterns, the post date block previously linked to the post ("isLink":true). With the featured image and post title already serving as links to the post, linked post dates resulted in duplicate link targets with non-unique accessible names when multiple posts were published on the same day. Following discussion on the issue and theme developer guidelines, "isLink":true has been removed from core/post-date across patterns, keeping dates purely as semantic informational <time> elements.

  2. Comments CTA Block Binding: The ipsum/comments-cta block binding renders call-to-action links ("Join the conversation" and "Be the first to comment"). When multiple posts appear in the loop, screen readers encounter identical link text pointing to different destinations. This pull request adds contextual screen reader text with the post title (<span class="screen-reader-text"> on %s</span>), aligning with WordPress Core's bundled core/post-comments-link standard (No comments<span class="screen-reader-text"> on %s</span>).

Screenshots

N/A — Structural accessibility enhancement. Visual appearance on screen remains identical, while screen readers and assistive technology receive unambiguous link names.

Testing Instructions

  1. Activate the Ipsum theme.
  2. In WordPress Admin, publish multiple posts on the same date. Enable comments on at least one post and ensure another has zero comments.
  3. Visit the blog index, archive, and search results templates.
  4. Verify that post dates are displayed as clean semantic text and are no longer redundant links.
  5. Inspect the "Join the conversation" and "Be the first to comment" links in the browser developer tools (or using a screen reader like VoiceOver).
  6. Confirm that each link includes <span class="screen-reader-text"> on [Post Title]</span>, ensuring unique and informative accessible names for assistive technology.

@github-actions github-actions Bot added [Area] Patterns Issues or PRs that touch the theme's block patterns. [Area] Theme Functions Issues or PRs that touch functions.php. labels Sep 23, 2026
@noruzzamans
noruzzamans marked this pull request as ready for review September 23, 2026 02:21
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: noruzzamans <noruzzaman@git.wordpress.org>
Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>
Co-authored-by: rahultank-spaceo <rahultank@git.wordpress.org>
Co-authored-by: henriqueiamarino <iamarinoh@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

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

@rahultank-spaceo

Copy link
Copy Markdown

Test Report

Patch tested: #93 (commit ea1bd81)

Environment

  • WordPress: 7.1.2 (WordPress Playground)
  • PHP: 8.3.33
  • Browser: Google Chrome 153.0.8010.52
  • OS: Linux
  • Theme: Ipsum (BEFORE: trunk at 06dff79, AFTER: PR head ea1bd81)
  • Plugins: none
  • WP_DEBUG, WP_DEBUG_LOG on, WP_DEBUG_DISPLAY off; pretty permalinks (/%postname%/)

Steps

  1. Activated Ipsum (trunk) on a clean WordPress Playground site.
  2. Created 4 posts in the category "Testing", each with a featured image and with comments open. Two posts share the same date (September 20, 2026), and one post has one approved comment.
  3. Visited the blog index, a category archive, search results (?s=) and a single post. On each page, I listed every <a> in the query loop (.wp-block-post-template > li) with its text, aria-label, href and the browser-computed accessible name.
  4. Repeated steps 1–3 with the PR branch.
  5. Checked debug.log.

Results

Check Before (trunk) After (PR #93)
Post date is a link (index, category, search) Yes, 4 of 4 No, 0 of 4
Post date is a link (single post: header date + "Keep reading" loop) Yes, 4 of 4 No, 0 of 4
Date text still displayed Yes Yes (rendered as <time>, same text)
Links per post in the loop: index 6 5
Links per post in the loop: category / search 4 3
Links per post in the loop: single post "Keep reading" 2 1
Links per post pointing to the exact same post URL: index / category / search 3 / 3 / 3 2 / 2 / 2
Links per post pointing to the exact same post URL: single "Keep reading" 2 1
Same accessible name, different targets: "September 20, 2026" (index, category, search) 2 links none
Same accessible name, different targets: "Be the first to comment" (index) 3 links none
Comments CTA accessible name (index) "Be the first to comment" / "Join the conversation" "Be the first to comment on {post title}" / "Join the conversation on {post title}"
Visible CTA text unchanged unchanged (the title is inside .screen-reader-text, which is visually hidden: 1px, clip-path: inset(50%), position: absolute)
Duplicate accessible names with different targets, any tested page 2 groups on index, 1 group on category and search none
PHP notices or warnings in debug.log none (no file written) none (no file written)

Expected result

Post dates in the query loops are shown as plain text, not links. Every link in the post list has a unique accessible name. The visible design stays the same, apart from the date no longer being underlined as a link.

Result: as expected on all tested templates.

Note: the branch currently conflicts with trunk in patterns/archive-columns.php (trunk removed the "Date and Categories" group around the date in #111), so it will need a rebase. The results above are from the PR head ea1bd81.

MaggieCabrera and others added 2 commits October 8, 2026 12:02
Resolves the conflict in archive-columns.php, where trunk no longer wraps the date in a group, by keeping trunk's markup and dropping the date link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Unlink the post dates in archive-lead and page-blog-home, which landed after WordPress#93.
- Unlink comment dates. The block links them by default, so comments from the same day shared a link name.
- Keep the comment avatar in the same tab. Its new-tab warning was only in an aria-label, so sighted visitors got none.
- Strip tags from the post title in the comments CTA's screen reader text, so titles with markup aren't read with their tags.

Part of WordPress#44.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaggieCabrera

Copy link
Copy Markdown
Contributor

I took this over to make a few changes:

  • Merged trunk and fixed the conflict in archive-columns.php.
  • Removed the date links from archive-lead and page-blog-home, which were added after this PR was opened.
  • Removed the comment date links, so comments from the same day don't share a link name.
  • Comment avatars now open in the same tab. The new-tab warning was only in an aria-label, so sighted visitors didn't get one.
  • Stripped HTML from the post title in the CTA's screen reader text, so titles with markup aren't read out with their tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Patterns Issues or PRs that touch the theme's block patterns. [Area] Theme Functions Issues or PRs that touch functions.php.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambiguous link texts found

3 participants