Jump to content

Can I add image titles below my gallery images in my flatiron template?

Recommended Posts

  • Replies 3
  • Views 313
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Add this to Settings > Advanced > Code Injection > Footer

This code will get ALT from Image & add ALT text under image

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>

   $('.gallery-item img[style]').each(function(){
       $el = $(this);
       var style = $el.attr('style');
    }); //Moves the inline styles

  $(".gallery-item img").each(function(){
            var title = this.alt;
          $('<div class="t-caption">'+ title +'</div>').insertAfter($(this).parent());
  #project .gallery .gallery-item {
    margin-bottom: 10px;



Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.