Jump to content

Any way to show filenames as image titles on a gallery page (Wells template 7.0)?

Recommended Posts

This is for a photographer who uploaded many images onto a gallery page and is trying not to manually insert titles for all images. The files are named, so they are looking to have the filenames (alt tag) show somewhere under each image (easiest I'm guessing would be in the image title or description fields). The site is in the Wells template in version 7.0. Is this possible? Nothing I've tried has worked yet. If not possible, any other suggestions are welcome! Much appreciated!

Screen Shot 2024-02-04 at 11.53.58 PM.png

Link to comment
  • Replies 7
  • Views 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Add this code to last line in Code Injection > Footer

<script>
  $(function(){

  $(".slide img").each(function(){
            var title = this.alt;
          $('<span class="t-caption">'+ title +'</span>').insertAfter($(this).parent());
        });
 }); 
</script>
<style>
 div.slide + .t-caption {
    display: none !important;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
}
div.slide.sqs-active-slide + .t-caption {
    display: block !important;
}
</style>

image.thumb.png.52c12b9c97b9f69691e427de45cb7f0f.png

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
  • 4 weeks later...

Hi, I am also having the same problem.  I would like the image file name to show under each image, without having to manually insert them.  I have tried the following injection code.

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

<script>
  $(function(){

  $(".slide img").each(function(){
            var title = this.alt;
          $('<span class="t-caption">'+ title +'</span>').insertAfter($(this).parent());
        });
 }); 
</script>
<style>
 div.slide + .t-caption {
    display: none !important;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
}
div.slide.sqs-active-slide + .t-caption {
    display: block !important;
}
</style>

Thank you for any help you could offer!

Link to comment
On 3/9/2024 at 5:32 PM, Carrot16 said:

Hi, I am also having the same problem.  I would like the image file name to show under each image, without having to manually insert them.  I have tried the following injection code.

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

<script>
  $(function(){

  $(".slide img").each(function(){
            var title = this.alt;
          $('<span class="t-caption">'+ title +'</span>').insertAfter($(this).parent());
        });
 }); 
</script>
<style>
 div.slide + .t-caption {
    display: none !important;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
}
div.slide.sqs-active-slide + .t-caption {
    display: block !important;
}
</style>

Thank you for any help you could offer!

Can you share link to your site?

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.