Hi! Can’t cope with the problem – removing titles.
Tried many ways, but the solution is partial
This removes titles only in list of galleries
function add_custom_tooltip(){
?>
<script>
jQuery(window).load(function(){
jQuery(‘a’).removeAttr(‘title’);
jQuery(‘img’).removeAttr(‘title’);
});
</script>
<?php
}
add_action(‘wp_footer’, ‘add_custom_tooltip’);
I want also remove titles from single gallery post, what should I do?
Hey Eru_Code_Master,
Adjust to this:
function add_custom_tooltip(){
?>
<script>
jQuery(window).load(function(){
jQuery(‘a’).removeAttr(‘title’);
jQuery(‘img’).removeAttr(‘title’);
jQuery(‘.av-masonry-image-container’).removeAttr(‘title’);
});
</script>
<?php
}
add_action(‘wp_footer’, ‘add_custom_tooltip’);
Best regards,
Jordan Shannon
Nothing changed =(
Hi,
Please provide admin info so we can log in and look into this issue further.
Best regards,
Jordan Shannon
Hi Eru_Code_Master,
Thanks for giving us admin access.
I have modified the code to:
function add_custom_script(){
?>
<script>
window.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('a,img,.av-masonry-image-container');
for(var i = 0; i < elems.length; i++) {
elems[i].removeAttribute('title');
}
}, false )
</script>
<?php
}
add_action('wp_head', 'add_custom_script');
Best regards,
Nikko
Great work, Nikko! Thank you very much, magician =)
Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon
