-
AuthorPosts
-
October 1, 2014 at 11:55 pm #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
October 2, 2014 at 9:49 am #328783Hey 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,
IsmaelOctober 2, 2014 at 1:39 pm #328915Hi 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
October 2, 2014 at 9:13 pm #329244Hello 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
October 4, 2014 at 5:22 am #330100Hi!
No, it will not add the caption on lightbox. You can edit the images on Media > Library. Add the caption as image title.
Cheers!
IsmaelOctober 4, 2014 at 7:15 pm #330262Hi 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
October 6, 2014 at 11:04 am #330773Dear 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
October 6, 2014 at 6:23 pm #331052Hi 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,
JosueOctober 6, 2014 at 8:02 pm #331126Josue,
You nailed it. Thank you!!!!!
Cheers,
Tim
October 6, 2014 at 9:30 pm #331182You are welcome Tim, glad to help :)
Regards,
JosueOctober 12, 2014 at 1:24 pm #334488I 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
-
AuthorPosts
- The topic ‘Show Captions in a WordPress Gallery’ is closed to new replies.