Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #328563

    Dear Team Kriesi:

    I’ve searched the forum for a solution, but no luck. I’ve got a WordPress gallery here:

    http://www.americanartistinrome.com/dev/blog/2012/12/21/copying-van-dyke/

    At the very least, I’d like the captions to show when the thumbnail is clicked, but I’d actually like the captions to also show under the thumbnails.

    Ideas on how I can do that with the default WordPress galleries?

    Thanks for the help.

    Cheers,

    Tim

    #328783

    Hey hypergolica!

    Thank you for using Enfold.

    You can show the default gallery captions but it will break the layout of the gallery. Add this on Quick CSS or custom.css:

    #top .gallery .gallery-item {
    margin: 1px 1px 0 0;
    width: 200px;
    height: 300px;
    padding: 0;
    }
    
    #top .gallery-caption {
    display: block;
    position: relative;
    }

    Play around with the css values to get the layout that you want.

    Regards,
    Ismael

    #328915

    Hi Ismael,

    Thanks for the reply. Will that also make the captions visible once each thumbnail is clicked, i.e., when it appears in the lightbox? If not, ideas on how I can do that?

    Thank you,

    Tim

    #329244

    Hello Ismael,

    You can see here that I’ve added the code you have suggested. However, where I would prefer to have the captions appear is in the full-size lightbox image.

    When I inspect the element, I can see a reference to <figcaption> but I don’t actually see any text for the caption (meaning, I’m guessing this isn’t fixed with a modification to CSS code), so what do I need to do?

    Please advise.

    Thank you,

    Tim

    #330100

    Hi!

    No, it will not add the caption on lightbox. You can edit the images on Media > Library. Add the caption as image title.

    Cheers!
    Ismael

    #330262

    Hi Ismael,

    I’d like to keep the title separate from the caption. Would it be possible for you to show me how to tweak the code to make this possible? I see that a thread was started on this very topic last year:

    https://kriesi.at/support/topic/add-caption-to-gallery-lightbox/

    …But, it would appear that no solution was ever provided, even though moderator “Dude” suggested in May of 2013 that a fix was on the way in an upcoming update.

    Any and all help would be greatly appreciated.

    Cheers,

    Tim

    #330773

    Dear Ismael and all at Kriesi:

    Could you provide a follow-up response to this? Knowing whether or not I will be able to do this could greatly affect I set up this website. And, as a website that is dealing exclusively with images, it’s rather important.

    Thank you for your time and assistance.

    Tim

    #331052

    Hi Tim,

    Try adding this at the very end of your theme / child theme functions.php file:

    function gallery_title_fix(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	$('.gallery-item img').each(function(){
                var lin = $(this).attr('alt');
                $(this).attr('title',lin);
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'gallery_title_fix');

    Regards,
    Josue

    #331126

    Josue,

    You nailed it. Thank you!!!!!

    Cheers,

    Tim

    #331182

    You are welcome Tim, glad to help :)

    Regards,
    Josue

    #334488

    I think this you can mark this as solved. (I would do it for you, but I don’t see that option at my end.)

    Cheers,

    Tim

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Show Captions in a WordPress Gallery’ is closed to new replies.