Setting image title (or alt attributes) as the Fancybox pop-in title

Note :This snippet works only with the Classical style option. More about the theme style option here


In Customizr (version less than 3.10), the title displayed at the bottom of the Fancybox popin is the post or page title instead of the image title.



To fix this, here’s a quick javascript snippet that displays the image title (or the alt field if there’s no title) for the FancyBox popin title.

Copy this code in your functions.php file :


 I hope this will be useful for you guys!

Your comments and improvements are welcome as always.


Related Snippets you may also like

3 thoughts on “Setting image title (or alt attributes) as the Fancybox pop-in title

  • Dario

    Customizer’s default Lightbox/Fancybox is great! However, I would like the theme to offer some simple/straightforward customizations. For instance, instead of the “img” type content I would like to use the “iframe” type. On “Image Details” I tried “Advanced Options” using class=”grouped_elements” with different rel=”tc-fancybox-group1..2.. 3…” but the fancybox pops-up always the same. Thx you in advance.

Comments are closed.