I can't get the title to appear in the img tag inside the Posts loop

Hello everyone,

I am posting directly here, because I can’t get the title to appear in the img tag inside the Posts loop.

Maybe I’m doing something wrong?

I’ll preface this by saying that the images all have alt and title.

Hey Giuseppe,

what is your exact setup? Are you manually creating a query loop to fetch some posts and output their featured images? And for the featured images you’re missing the title attributes?

Best,

André

Hi André,

I am using the simple “Posts” element in grid mode, without a custom query (default). The featured images used, contain both alt txt and title (same). I have not tried with a custom loop.

I saw that the alt text is present but the title is empty on all of them.

PS This is not fonfamental, but it seemed unusual for me…

Thanks for the response

Hey Giuseppe,

as this is not a real image (<img> tag) but a <div> with a background image instead there is neither an alt nor a title attribute (the empty title attribute should not be there at all).

If you want to use a real image with all those attributes consider using a query loop instead.

Best,

André

Hi André,

Ciaro!!! I see what you mean, if I use the plain image (img), it should be fine.

Thanks for the clarification

Giuseppe