Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #588649

    Hello!

    I am using image captions to display additional information in the lightbox. When you hover over the image in the gallery the tooltip hover displays the full caption HTML. See the screenshot below. Is there a way to prevent the caption from displaying on hover like this?

    https://www.dropbox.com/s/mcgt3pw82fiwaqb/captions.jpg?dl=0

    #589896
    #590081

    Thanks for the assistance!

    This almost works. The problem is that the function removes the caption everywhere. I still want the caption to still display in the lightbo of images, just not on hover over the images. When you hover it shows the HTML as pictured in the screenshot attached above.

    #591036

    Hey!

    Please try changing the code to following one

    function remove_title_attr(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.flex_column a').removeAttr('title');
    jQuery('.flex_column img').removeAttr('title');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'remove_title_attr');

    Cheers!
    Yigit

    #748921

    @ghrahams did @Yigit ‘s last code snippet worked for you?

    I would like to achieve exactly the same as you:

    • Masonry Gallery
    • when hovering an image, no title attribute should be visible (like here in docu)
    • but when opening the lightbox of this image, the HTML code I entered in the image description should be shown!

    The snippet of Yigit does not work for me, because then also the lightbox text including links in the image caption is deleted.

    #751747

    Hi Chris,

    Have you tried 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');

    If you have and that did not work for you, please start a new thread and attach temporary admin logins in private content field. If you post them here, they will be visible to creator of this thread as well.

    Best regards,
    Yigit

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