WP- How to add alt text for slider images

Guru Prasath's Avatar

Guru Prasath

07 May, 2018 04:26 AM

Hello,

When using the wordpress plugin how and what is the best way to put alt tag for the slider images? For accessibility reasons, I need to put alt text for all sliding images. How to achieve this?

Thanks

  1. Support Staff 1 Posted by Dmitry Semenov on 07 May, 2018 04:01 PM

    Dmitry Semenov's Avatar

    Hello,

    Source of alt attribute is different depending on type of slider that you're using, usually it's based on a title of a slide. Besides that, if you're using lazy-loading, initial markup will contain link elements (<a>) instead of img.

    If you wish to modify markup of slider image, in General options section click on Edit Slide Markup and replace {{image_tag}} with desired structure, for example:

    <img class="rsImg" src="{{image_url}}" alt="{{title}}" />
    
  2. 2 Posted by Guru Prasath on 07 May, 2018 06:44 PM

    Guru Prasath's Avatar

    Hello,

    Thank you for your response. I'm using a theme which has this plugin in-built but I don't see an option to add my own markup. I only have option to select the images to run a slideshow. Is there any other alternative way that I can add the alt tag for the images on the slider?

    Thanks

  3. 3 Posted by Guru Prasath on 07 May, 2018 06:45 PM

    Guru Prasath's Avatar

    Also when will this event get triggered? -- slider.slides[2].holder.on('rsAfterContentSet', function() {});

    This for some reason is not working for me.

  4. Support Staff 4 Posted by Dmitry Semenov on 07 May, 2018 08:02 PM

    Dmitry Semenov's Avatar

    Thank you for your response. I'm using a theme which has this plugin in-built but I don't see an option to add my own markup

    If you aren't using WP version of slider, consider asking your theme developer, or check docs of HTML version http://dimsemenov.com/plugins/royal-slider/documentation/#basic-usage

    Also when will this event get triggered? -- slider.slides[2].holder.on('rsAfterContentSet', function() {});

    I'd need a link to the page that you're working on.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac