Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archives: Update the main heading on all filter views #193

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Sep 27, 2023

Fixes #180 — This updates the query-title block so that it always outputs heading text on filtered archive views. The heading is still invisible, it's currently there for screen reader users & SEO.

For example:

  • /archives/?tag[]=dining — "Filter by: Dining"
  • /archives/?tag[]=dining&cat[]=3 — "Filter by: Dining, Featured"
  • /archives/?cat[]=3&s=restaurant — Filter by: Featured, restaurant

To test

Try any number of filter combinations on the archives page. There should always be an h1 on the page, and the title should match the current filters. You can use a bookmarklet like this one to test.

Also check the document title, it should reflect the currently-selected filters too.

If you want, switch out the query-title in patterns/_site-grid.php with the following, for a visible heading.

<!-- wp:query-title {"type":"filter","style":{"spacing":{"margin":{"top":"-20px","bottom":"var:preset|spacing|40"}}}} /-->

@ryelle ryelle added [Component] Blocks/Editor Custom blocks, block variations, or editor customization Accessibility Issues related to keyboard navigation, screen readers, etc labels Sep 27, 2023
@ryelle ryelle self-assigned this Sep 27, 2023
@ryelle ryelle merged commit 71624dd into main Sep 28, 2023
1 check passed
@ryelle ryelle deleted the update/archive-title branch September 28, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Issues related to keyboard navigation, screen readers, etc [Component] Blocks/Editor Custom blocks, block variations, or editor customization
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Some archive pages don't have a main heading
1 participant