You can change the attachment point of the accessibility toolbar so that it attaches somewhere other than the body element. The body element is the only one that WP Accessibility can know for certain will be present, so that’s the default, but you can change it.
Hello Joe,
Thanks for your prompt response.
Excuse my ignorance but can you explain how to do that please?
Thanks Guy
On the main WP Accessibility settings screen, there’s a field for toolbar location. That accepts an ID attribute for any element on the page, and will attach the toolbar to the element with that ID.
Twenty Twenty Four makes this more difficult than necessary, because there aren’t really ID attributes on the page. I’ll have to think about that. I can give you the instructions for editing theme templates in the Site Editor, but they’re a bit involved:
Add ID to templates:
Open Site Editor: Navigate to Appearance > Editor in your WordPress dashboard.Select Template: Click on Templates and select all the templates you use (e.g., page.html, single.html, and index.html).
Edit Content Structure:
- Click the List View icon (three stacked lines) in the top-left corner to see the template structure.
- Locate the
<!-- wp:group --> or <!-- wp:post-content --> block that wraps your main content.
Add the ID:
- Select the block, click the three dots on the block toolbar, and choose Edit as HTML.
- Add the
id attribute directly into the HTML tag. For example:
<main id="main-content" class="wp-block-group">
Save Changes: Click Save in the top-right corner