Home › Forums › UPFront WordPress Theme › Gallery Shortcode – Show caption also on the enlarged image
- This topic has 1 reply, 1 voice, and was last updated 6 years, 2 months ago by
brunodario.
- AuthorPosts
- September 21, 2017 at 3:43 pm #13505
Hey there, i’ll have to ask for your help again:
When i use the Gallery shortcode on a post i can choose to show or not show the image caption on mouseover, witch is great for me since this website needs to show photo credits. We need to show the image caption on the enlarged version (after the user clicks the image and it shows the enlarged one).
I can see that the shortcode uses lightbox so i know for a fact that this is possible by adding “data-title”attr to the link, but how can i enable it?
Thx in advance
September 21, 2017 at 9:57 pm #13506Got it figured out with jquery, the code below will grab the text of the caption and insert it as the title attribute as desired.
jQuery( "span.collage-caption" ).each(function() { var titleattr = jQuery(this).text(); jQuery(this).prev().attr('title', titleattr); });
Anyway, it would be nice to have a similar option to enable / disable this feature on the shortcode` (show title on enlarged image)
- AuthorPosts
- You must be logged in to reply to this topic.