This topic has 8 replies, 2 voices, and was last updated 7 years, 11 months ago ago by Eva Kemp
Hello,
is there a way to prevent the image title from showing up at mouseover?
many thanks in advance!
Hello,
Add this code in footer.php file before </body>
tag:
<script type="text/javascript">
jQuery(document).ready(function($){
jQuery('img').removeAttr('title');
});
</script>
Regards,
Eva Kemp.
Thank you very much for your soon reply! Is it possible to modify this code to use it in functions.php instead?
Hello,
You can create child theme and add footer.php file to the child theme. This way you won’t lose modifications after theme update.
Regards,
Eva Kemp.
Yes I know but I dont want to add to many template files into my childtheme. I always prefer to use functions.php of my childtheme for modifications. So, isn’t there a way to achieve this via functions.php?
Hello,
Please try this code in functions.php file:
function add_custom_script(){
?>
<script>
jQuery(document).ready(function($){
jQuery('img').removeAttr('title');
});
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Regards,
Eva Kemp.
Works perfect, thank you very much!
Hello,
You’re welcome.
Regards,
Eva Kemp.
The issue related to '‘Hide image title when mouseover in product archive’' has been successfully resolved, and the topic is now closed for further responses