Archived topic
search bar anchor title attribute
5 replies · Started by Shane on March 13, 2020
Trying to make our website meet WCAG 2.0 for accessibility and one item that needs to be met is adding a title tag to the search bar anchor . The tag in questions looks like this
<a href="#">
Where / How can i add a title attribute to this tag?
Thank you for your time in advance.
Sorry. the code is this.
<a aria-label="Open Search Bar" href="#">
Hi there,
Are you referring to the GP's navigation search? If so you can modify the output with this filter:
https://docs.generatepress.com/article/generate_navigation_search_output/
Let me know if this helps :)
Trying to meet WCAG 2.0 compliance and we get notified that anchor tag for the search bar requires a title attribute. I have found and manually added a title tag to the theme generatepress/inc/structure/navigation.php file on lines 113, 322, and 357 to comply however this will reset everytime there is an update to the theme. Could you look into adding a title tag to the anchor tag for the Search bar, and/or guidence to prevent updates from overriding the manual inclusion of the title attribute?
We likely won't add it by default, as the aria-label attribute handles it better for screen readers.
However, I'll look into filtering the menu item so it's possible to add it when needed.
I am having the same issue with Shane.
If there's option to add a title attribute to the code it will be perfect.