Ats on Logo Carousel Slider

I have the logo carousel slider added to https://virginiasfurniturehire.co.uk/. The looper raw content for the images is currently <img src="{{dc:looper:field key=“image”}}" alt="{{dc:postalttext}}" /> The alts wern’t showing

I also found
//Use: {{dc:postalttext}}
add_filter( ‘cs_dynamic_content_postalttext’, function( $result, $field, $args) {
$image_id = get_post_thumbnail_id(get_the_ID(), ‘postalttext’);
$result = get_post_meta($image_id, ‘_wp_attachment_image_alt’, true);
return $result;
}, 10, 3 );
on another forum post, so I’ve tried adding this to make it work, but the alt still shows as alt, there’s no tag showing.

Please can you help

Hi @simonwr1976,

Thanks for reaching out.
Although this falls under custom coding and is beyond the scope of Theme Support , I can still share a few pointers.

First, you’ll need to pass the image ID to the Dynamic Content , something like:

{{dc:postalttext id="1845"}}

Then, you can fetch the data from the _wp_attachment_image_alt meta field to retrieve the alt text that’s added to the image in the Media Library .

If you’re not comfortable with coding, I’d recommend hiring a developer to assist with this customization. Alternatively, you can explore our One TOTAL CARE service, where we offer help with small customizations.

Thanks,

Thanks for the reply.

I’m using the logo carousel slider from the modern sliders which I’ve paid for, so I would have thought that adding alts to individual images in a slider that you’ve created would have fitted in within the scope?

That said, thanks for your help, but adding the id isn’t going to work, as the looper has more than one image.

Could the alt be added to the looper?

Hi @simonwr1976,

As you are using the JSON, you can add another attribute to the JSON and add the Alternative Text for each image, and add it to the image tag using {{dc:looper:field key="alt"}}

{
    "company"     : "Soho House",
    "image"       : "https://virginiasfurniturehire.co.uk/wp-content/uploads/2018/06/soho-house-a.jpg",
    "alt"         : "test",
    "height"      : "0.3em",
    "positionTop" : "0.25em"
}

<img src="{{dc:looper:field key="image"}}" alt="{{dc:looper:field key="alt"}}" />

Hope it helps.
Thanks

That’s great, thanks

Hi @simonwr1976,

Glad that we are able to help you.

Thanks