Add alt attribute in slider images on the homepage

Hi,

I really like the Sydney Theme, and I was wondering if there was a way to modify a template (I use a child theme) to insert the alt attribute on the slider images, as they don’t seem to be present.

Any hint? Thank you very much.

Hello @stefanp44,

Can you please provide a link to your website?

Kind Regards, Roman.

Hi,

Yes of course, here it is : https://panier-legumes.bio/

It is still under development mind you, so you’ll need these to access it :
login : stef
pass : stef1512

Best regards, Stephane

Hello Stephane,

Sydney slider uses background property to add image, not img element.

Thus, I don’t think that there is an easy way to add alt attribute.

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.

Hi,

I checked the source code: it doesn’t look like a background image. See for yourself:

First, the CSS

.slide-item {
				background-image: none !important;
			}

and then the HTML part

<div class="slide-item" style="background-image:url('https://panier-legumes.bio/wp-content/uploads/2017/04/maraicher-bio-gaec-dureau.jpg');">
                    <img class="mobile-slide preserve" src="https://panier-legumes.bio/wp-content/uploads/2017/04/maraicher-bio-gaec-dureau.jpg"/>
                    <div class="slide-inner">
                        <div class="contain animated fadeInRightBig text-slider">
                        <h2 class="maintitle">Bienvenue à GAEC Dureau</h2>
                        <p class="subtitle">Fruits et légumes bio à Chaumes en Retz</p>
                        </div>

As you can see, the img tag is there but not alt attribute, and no width or height either. If you could point me to the right template, it’d be much appreciated :slight_smile:

Best regards,

Sorry please do not respond to my message, I just realized. The img tag is there only for mobile devices. Never mind ! And thanks for your answer (I really feel like a fool now…)

That’s okay Stephane, have a nice day :slight_smile:

Kind Regards, Roman.

Hi Roman,

I understand that the Sydney theme uses background image for desktop systems and that an “alt” attribute is not possible in that case.

But I think that the real issue is : why is the “alt” attribute not added in the img element which is used for mobile devices ? I fear that Google is ranking my website badly because of this. (https://repairenzo.be/)

Can you help me out here ? Note that I do not use a child theme.

Best regards,
Claus

Hello Claus,

Please create a new topic for your issue to keep forum in good order and make it easier to help you.

Kind Regards, Roman.