hi guys my seo site auditor tool is telling me a logo file on the home page of my site has no alt tag, this file
https://www.manchestercoachhire.com/wp-content/uploads/2016/02/MANCHESTER-COACH-HIRE-LOGo-web-white-300×82.png
the site is
the filename in question is MANCHESTER-COACH-HIRE-LOGo-web-white-300×82.png
however i did add it in the media library so how come it isn’t showing? how can i get it to show?
well that Logo is the alternate logo – set for transparency Option.
You can add alt and title attribute by child-theme functions.php:
function custom_alternate_logo_attriubtes(){
?>
<script>
(function($){
$('.logo img.alternate').attr({ title:"Manchester Coach Hire Logo", alt:"Manchester Coach Hire" });
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'custom_alternate_logo_attriubtes');
hi i tried to add that but it seems to have not done anything on https://www.manchestercoachhire.com/
by the way : if you like to have on logo ( non transparency one) a title tag too – add one line for it above:
function custom_logo_attriubtes(){
?>
<script>
(function($){
$('.logo img').attr({ title:"custom_title", alt:"custom_alt" });
$('.logo img.alternate').attr({ title:"transparent Logo", alt:"Alt Transparent" });
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'custom_logo_attriubtes');
Hi,
Thanks for helping out @guenni007, did you manage to get this working @codecreative?
Best regards,
Rikard