Jump to content

Code no longer works for showing image name/titles in galleries? Help please

Recommended Posts

Site URL: http://www.maddieparkerphotography.com/

I have been using the following code for a number of years. I'm a photographer that uploads a number of images into a gallery. By using this code, it usually saves me a lot of time by displaying the image name/titles underneath (rather than me having to go through and individual type in each title for each image). Up until today, it's decided not to work anymore. I usually place the code at the bottom of an individual page underneath the uploaded gallery. 

This is the code:  

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
 <script>
   $('.slide img').each(function(i) {
     $('.image-slide-title').eq(i).html('' + $(this).attr('alt').replace('.jpg', '') + '');
   });
 </script>

 

However it no longer works. Please does anyone have a new code that still works please? Or anyone that is good at coding that could help me alter mine to work? I'm really not very good at coding so don't know what to do.

Thanks

Link to comment

I think it's a bug, all alt text is also not showing on gallery blocks and sections.

If an answer I provide helps you, please mark it as the answer so others can easily access it as well.

I'm a Squarespace Authorized TrainerSquarespace Expert, and Circle Member and I've been helping my clients as well as those here in the forum and in various Squarespace groups with custom coding and support for Squarespace websites. I would love to help you in any way I can.

Squarespace PluginsBook Live Help | Squarespace Video Tutorials | Buy Me a Coffee

Link to comment

I've checked four pages and I'm not finding the code installed. Can you point us to a specific page you know that code has been installed? Are you installing the code via a code block at the end of the page?

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Hi @creedonand @Vigasan

 

When on the page I am creating, underneath a gallery block I am then adding a 'code' block at the end of the page. Then I am pasting the above code in. Usually once saved the image titles/names appear. 

 

The pages I am using them on are password protected as they are my client galleries. Would I be able to message you @creedonwith the details to access one? 

 

Thanks

Link to comment

@MaddieParker To reiterate what others have said, this is Squarespace Bug. There's supposed to be an attribute called the ALT tag on every image on every webpage. Unfortunately, Squarespace have made an update and these tags are now missing - on all sites that I've tested.

There's nothing any of us can do to fix this. You'll need to wait until Squarespace acknowledge this and then fix it.

I logged a support ticket with Customer Care but they seemed to be completely unaware of it. I recommend that you also get in touch with Squarespace Customer Care. I wouldn't mention custom code (they don't assist with this) but you can tell them that ALT tags are missing from your images. You can reach out to them here.

Update: Fixed on Friday 25 June.

Edited by paul2009

About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.
If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too.

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.