Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter massimod

    (@massimod)

    To be more exact, the Caption is displayed but with no link (unlinked, stripped).

    Plugin Author arisoft

    (@arisoft)

    Hello,

    Could you provide a link to a page with caption and alt text where the lightbox is used?

    Thread Starter massimod

    (@massimod)

    Not sure what you mean, but here is an example:

    https://www.travel-world.eu/europe/united-kingdom/blackpool-city-guide/

    Plugin Author arisoft

    (@arisoft)

    Open “Advanced” tab on plugin settings page and populate “Custom JS code” parameter with the following value:

    setTimeout(function() { $('.wp-caption').each(function() { var $this = $(this),$a = $(this).find('A[rel*=lightbox]'),$caption=$(this).find('.wp-caption-text'); if (!$a.length) return ; $a.attr('data-caption', $a.find('IMG[alt]').attr('alt') || ''); $a.attr('data-description', $caption.html()); }); }, 100);

    Thread Starter massimod

    (@massimod)

    Thanks, it doesn’t seem to work. No full caption and not at all the Alt text.

    There is no rush, i wish you include some options about that in a future version.

    I leave it online, check my previous link again to see your plugin and what it shows.

    Plugin Author arisoft

    (@arisoft)

    Try the following code please:

    setTimeout(function() { $('.wp-caption').each(function() { var $this = $(this),$a = $(this).find('A.ari-fancybox'),title=$a.find('IMG[alt]').attr('alt') || '',description=$(this).find('.wp-caption-text').html() || ''; if (!$a.length) return ; $a.attr('data-caption', title + '<br>' + description); }); }, 100);

    Thread Starter massimod

    (@massimod)

    That second script works nicely.

    Many thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show Caption and Alt text ?’ is closed to new replies.