• Resolved WiSch

    (@wisch)


    Hi.

    How can I get the alt-text als caption in the lightbox instead the title?

    Thanks for your support,
    J?rg

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, have you set the option “Allow title from Alt”?

    Thread Starter WiSch

    (@wisch)

    Hi.

    I didn’t know what changed, maybe the last update but…
    Now it works as I want it.

    The suggested option was set before but when I leave the alt-tag blank the title was shown instead of leave the caption blank.
    So I used a little snippet I found on the net:

    // ALT-Text as Lightbox-Caption instead of the title
    // https://kriesi.at/support/topic/lightbox-displaying-alt-tag-below-image/
    function gallery_title_fix(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
          $('img').each(function(){
                var lin = $(this).attr('alt');
                $(this).attr('title',lin);
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'gallery_title_fix');

    But now it does what I expect without the snippet.

    So… thanks for your support, whatever you did! ??

    Regards,
    J?rg

    I have no idea (the plugin was not updated recently) but good to hear it works well for you now ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use ALT-text as caption’ is closed to new replies.