Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #586262

    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

    #587252
    #589858

    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

    #592541

    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

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