Home Forums UPFront WordPress Theme Gallery Shortcode – Show caption also on the enlarged image

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13505
    brunodario
    Participant
    Purchased
    Expired

    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

    #13506
    brunodario
    Participant
    Purchased
    Expired

    Got 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)

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

Join Newsletter(FREE)

Subscribe to our newsletter to receive news & updates. We promise to not spam you, super promise!