Tagged: Lightbox
Hi there,
is there any chance to use the image caption for the lightbox? Currently the magnific lightbox takes the description. Is there any deeper background why you decided for the description field and not for the caption field?
Thanks for helping me out.
Best regards
Oliver
Hi Oliver!
please refer to: https://kriesi.at/support/topic/image-caption-show-in-lightbox/#post-456232
Best regards,
Andy
Hi Andy,
thanks for your reply. It doesn’t exactly answer my question. I know that an image has different content types in its metadata. I normally use
– title
– caption
– description
– alt text
– keywords
From this list the Magnific Popup uses the field “description”. When I opened the ticket I had a need for the content in field “caption”. Meanwhile I have found another solution which makes a change obsolete. Nevertheless it would be wonderful to learn where to tweak the code in order to pull content from the caption field of the image to the Magnific Popup caption.
Best regards
Oliver
Hi!
What is the element that you use? You can find the script in the js > avia.js file, line 913:
image: {
titleSrc: function(item){
var title = item.el.attr('title');
if(!title) title = item.el.find('img').attr('title');
if(!title) title = item.el.parent().next('.wp-caption-text').html();
if(typeof title == "undefined") return "";
return title;
}
It will look for the title attribute of the img element, if not found, get the text from the wp-caption-text container.
Best regards,
Ismael