Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6420

    Hello,

    first of all thanks for the great theme. My problem is:

    there is no image alt tags anywhere in the theme, the only thing I can see in the source code is “alt” and there is no way to replace it with the correct alt tag I’d like to set in there. How can I add ALT tags to images in Shoutbox theme?

    Thank you

    #54068

    Hey,

    the alt tag used is actually the ‘Description’ field in the media library – so you need to put your alt text into the ‘Description’ field for each image.

    #54069

    HI,

    ok great but I’d like to replace those tags with the value of a custom field, so I’d like to know which code I could modify to achieve this. Where exactly in the theme files do you define image ALT tags.

    Thank you!

    #54070

    Hey,

    you can’t use custom fields to target a specific image from the library as you can’t target a specific image when there are multiple images added to the post. As Dude said, you can easily modify the Alt tags in your media library. Simply put your value for the alt tag in your Description of the image and it will work fine. Could you elaborate why you’d want to use custom fields?

    #54071

    Hi,

    I don’t want to append the value of a custom field to the description of the image file itself, just output it in the theme. So my custom field is the name of a web merchand, I already enter it manually, so if I had to manually reenter it for the post image (only one) it shouldn’t help me a lot. There must be a way to replace the alt tag automatically. I couldn’t find it however.

    Regards

    #54072

    Hey,

    open up shoutboxframeworkphpfunction-set-avia-frontend.php

    and replace:

    return "<img src='".$image_src[0]."' title='".$image_title."' alt='".$image_description."' />";

    with:

    return "<img src='".$image_src[0]."' title='".$image_title."' alt='my-alt' />";

    Instead of “my-alt” enter your own text.

    #54073

    Great,

    that’s what I was looking for from the very beginning, here’s what I’ve added to customize it my way:

    $image_alt = get_the_title();

    return “".$image_alt."“;

    and then I’ve removed the overlay from the images, in order to hide the title on top of them

    Thank you for the fast answer

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Image ALT tags missing’ is closed to new replies.