Tagged: image description, image title, Lightbox, Masonry Gallery
-
AuthorPosts
-
December 13, 2016 at 12:48 am #723469
Hi,
I found in the documentation this post:
“Remove image titles that show up when you hover on images”, so far, so good.But:
with this code snippet, that is mentioned there, the image description in lightboxes (for example “Masonry Gallery” items opened in a lightbox) show no image description. This issue is documented here:So, generally asked, is there a “workaround”, so that the image titles are not shown, when hovering for example portfolio or gallery images, but that the image descriptions in lightboxes are still shown?
Thank you.
December 14, 2016 at 7:05 pm #724450Hey Chris,
Please use the code as following
function remove_title_attr(){ ?> <script> jQuery(window).load(function(){ jQuery('#wrap_all a').removeAttr('title'); jQuery('#wrap_all img').removeAttr('title'); }); </script> <?php } add_action('wp_footer', 'remove_title_attr');
I will update the post on our documentation
Best regards,
YigitDecember 14, 2016 at 11:20 pm #724636Thank you, this code snippet makes, that the image title on hover disappears, so far so good.
But all other images in a page, opened in a lightbox have no image title in the lightbox:The left image in this screenshot shows the result without your code snippet, the right image is the result with your code snippet.
These images in this case are created in a page with the “Masonry Gallery” ALB element and the images are set to be opened in a lightbox:
Is it possible to hide the image title on the hover over a normal image, but hide the image title, if the image is openend in a lightbox?
Thank you.December 19, 2016 at 6:31 am #725954Hi!
I’m sorry but this is not possible. The lightbox script requires the title attribute. Please remove the script above if you want the lightbox to display the title.
Best regards,
IsmaelMay 9, 2017 at 7:11 pm #790517Hello,
Thanks for the code but it doesn’t work for the masonry portfolio.
Is there a way to remove these tag from Masonry Portfolio. Masonry portfolio creates automatically based on the name of the portfolio item. Removing title from the image doesn’t work there.
May 10, 2017 at 9:14 am #790929Hi,
The snippet above should work for the masonry element. Could you please provide a link to the page with the masonry? We would like to check it.
Best regards,
IsmaelMay 10, 2017 at 9:18 am #790930Hi Ismael,
Could you tell me where exactly to put the snippet? Maybe I put it in a wrong file.Regards
- This reply was modified 7 years, 6 months ago by pavlika.
May 10, 2017 at 5:49 pm #791239Hi,
You can put the code snippet at the bottom of functions.php file. If you are using a child theme put it in the child theme’s functions.php if not, put it in enfold theme’s functions.php
Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.