Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #724450

    Hey 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,
    Yigit

    #724636

    Thank 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.

    #725954

    Hi!

    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,
    Ismael

    #790517

    Hello,

    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.

    #790929

    Hi,

    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,
    Ismael

    #790930

    Hi 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, 7 months ago by pavlika.
    #791239

    Hi,

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.