Tagged: Lightbox
Hi,
this is mentioned in the documentation:
It is a browser feature but it is possible to hide them by adding following code to Functions.php file of your child theme in Appearance > Editor
function remove_title_attr(){
?>
<script>
jQuery(window).on('load', function(){
jQuery('#wrap_all a').removeAttr('title');
jQuery('#wrap_all img').removeAttr('title');
});
</script>
<?php
}
add_action('wp_footer', 'remove_title_attr');
so far so good, but:
with this active, the lightbox of Masonry Gallery for example show no image title. When disabling this function, then the title of the images are shown in the lightbox.
Is there a workaround so that this feature can be ACTIVE and STILL display the image titles in the lightbox?
Thanks.
Hey BeeCee,
Thank you for the inquiry.
The value of the title attribute is actually used in the lightbox container, so removing the title will also affect the lightbox. Another user posted a script that only removes or hides the title on mouse hover and brings it back on mouse out. Please check the thread below.
Best regards,
Ismael