Remove image alt title text on hover
-
Hi,
I am using this function to remove the hover alt/title text on the product images but for some reason it is not working in Woodmart. Can you check what’s wrong with this function please?
/*----------------------------------------
// Remove Image Title on hover
//--------------------------------------*/
function removeImageTitleOnHover(){
?>
<script>
jQuery(document).ready(function() {
var imgTitle;
jQuery("img").hover(function(){
imgTitle = jQuery(this).attr("title");
jQuery(this).removeAttr("title");
}, function(){
jQuery(this).attr("title", imgTitle);
});
});
</script>
<?php
}
add_action('wp_footer', 'removeImageTitleOnHover');
It’s the hover over the thumbnails in the gallery – see here: https://ugames.com.au/product/kids-18pc-tinned-game-asst/
Thank you in advance!
Hi,
We just checked your website but don’t see the code in the page source. Did you add it already?
Regards
I temporarily disabled it as I was not seeing any Titles in the backend. I just want to remove them from the hover, not in the backend due to SEO usage.
So the code works with all images except product page? Please, add it now so we can check what is wrong there.
I had put it back but it was doing nothing, so I found an (old) plugin that seems to do the trick – it removes the title attribute completely but keeps the alt attribute.
OK, we are glad that you sorted this out.