Tagged: gallery
Hi,
I have a gallery setup and I’d like to display the title of the image below the image in the gallery. I try to use the style options but it doesn’t show. How can I fix this? I put a link to the page in the private content.
Hey MikeTandySwag,
Thank you for the inquiry.
There is no option for this by default, but you can add captions to the images, and it will display as a tooltip. Alternatively, you can use this script in the functions.php file:
function ava_custom_script_gallery_title()
{
?>
<script>
(function ($)
{
function g()
{
$('.avia-gallery-thumb img[data-avia-tooltip]').each(function () {
var tooltipText = $(this).attr('data-avia-tooltip');
var paragraph = $('<p></p>').text(tooltipText);
$(this).after(paragraph);
});
}
$(document).ready(function ()
{
g();
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'ava_custom_script_gallery_title');
Best regards,
Ismael