-
AuthorPosts
-
September 16, 2019 at 4:28 pm #1138862
Hello there,
When I click to a photo in masonry gallery, I see title text under image. But I want to see excerpt text under it.
Is that possible by codes? There is no option in mansonry gallery blog settings.I don’t mean grid view. I mean single photo view when I click to see.
September 17, 2019 at 3:02 pm #1139129Hey Cemal Onur,
I’m not sure I understand your request, since there is not excerpt for images?
Best regards,
RikardSeptember 17, 2019 at 3:07 pm #1139132I mean image captions text. Masonry gallery calls that like “excerpt” in option windows.
September 20, 2019 at 2:18 am #1140072Hi,
Thank you for the update.
This is possible, but you have to manually edit the title of the images in the Media > Library panel. The value of the title attribute is what the lightbox display as caption.
Best regards,
IsmaelSeptember 20, 2019 at 11:04 am #1140177Hi Ismael,
Thanks for answer. But I think you didn’t understand what I wanted. I already know that title value is shown at lightbox display. But I want to see capture value under image at lightbox display.
September 20, 2019 at 2:05 pm #1140219Hi,
Sorry for the confusion. We do understand your inquiry. What you need to do is put the excerpt or caption in the title attribute of the image manually. You can do that in the Media > Library. That is the only solution that will not require file modification.
If you’re OK modifying the parent theme file, edit the js > avia-snippet-lightbox.js script. Look for this code:
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; } },
This code looks for the title attribute or the wp-caption-text container.
Best regards,
IsmaelSeptember 29, 2019 at 1:24 pm #1143078Hi Ismael,
I have tried to change that code but it didn’t work. I deleted all that codes to be sure if it is about that code, there was not any change.
Did you try it in your parent ? If you tried and it works what you did, may I learn your way?
September 30, 2019 at 11:09 am #1143289Hi onurized,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaOctober 1, 2019 at 3:26 pm #1143787Hello Victoria,
Thanks for your answer. Example page is kazdaglariotel.com/projeleri/manisa-villa-bahcesi/
I have shared admin informations as private content.
October 3, 2019 at 10:31 am #1144422Hi,
Thank you for the update.
We modified the js > avia-snippet-lightbox.js, have the script look for the content of the av-masonry-entry-content container, and use it as the title.
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(item.el[0].classList.contains('av-masonry-entry')) title = item.el.find('.av-masonry-entry-content').html(); if(typeof title == "undefined") return ""; return title; }
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.