Archived topic
Logo Alt TExt and Web Accesibility
7 replies · Started by John on March 28, 2021
Hi there,
Wondering if you guys can help me figure out why the ALT Text of this site is showing as repeated in an ADA Web compatability test.
The site I am testing on is: https://wave.webaim.org
The website I am testing is: https://beingwellflorida.com
The error I am getting is that there is redundant title text:
div class="site-logo"><a href="https://beingwellflorida.com/" title="Being Well Medicine, Florida" rel="home">
Linked image with alternative textRedundant title text<img class="header-image is-logo-image" alt="Being Well Medicine, Florida" src="https://beingwellflorida.com/wp-content/uploads/2020/10/Being-Well-Medicine_E2H_web.png" title="Being Well Medicine, Florida">
</a></div>
But I have changes the alt text, the title text and even the site title text. Nothing changes the error.
Does GeneratePress store/take the info from somewhere else for the alt attributes?
Many thanks!
John
Hi there,
Here's how the logo is generated.
https://github.com/tomusborne/generatepress/blob/7b35168f546f83a7abb098a8da3bc0674d49ddeb/inc/structure/header.php#L109
Perhaps the compatibility test finds the link title and the image title redundant. You can remove the image title attribute using the filter generate_logo_attributes.
Example PHP snippet:
add_filter( 'generate_logo_attributes', function( $atts ) {
unset( $atts['title'] );
return $atts;
} );
Thank you for this - I never did respond...apologies.
Can you tell me how I can apply a similar snippet for a logo which is added to a Header element.
For example:
On this home page:
https://drtanyahudson.health
I get the same error - I have applied the snippet above to the site - so it works on pages where the theme calls on the logo added to the customizer - but not on this page.
Any ideas?
Thanks again
Can you try using these filters to change the logo attributes?
For
For Mobile header logo - https://docs.generatepress.com/article/generate_mobile_header_logo_output/
For Desktop logo - https://docs.generatepress.com/article/generate_logo_output/
Or this one - https://docs.generatepress.com/article/generate_navigation_logo_output/
I am not sure how to proceed.
Do I edit the first snippet to include the names of the others?
For example:
add_filter( 'generate_logo_output', function( $atts ) {
unset( $atts['title'] );
return $atts;
} );
When I try this I get the WSOD.
Or is there a different way to get the same result?
Hi there,
It's the same kind of thing just with a slightly different filter: generate_page_hero_logo_attributes
add_filter( 'generate_page_hero_logo_attributes', function( $atts ) {
unset( $atts['title'] );
return $atts;
} );
Hope this helps! :)
Thanks Tom - that did the rick. Appreciate it.
No problem!