To be more exact, the Caption is displayed but with no link (unlinked, stripped).
Hello,
Could you provide a link to a page with caption and alt text where the lightbox is used?
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);
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.
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);
That second script works nicely.
Many thanks.