• Resolved Robin

    (@robin-ho)


    I’m creating a new gallery and the images are not pulling the alt text already defined in the WP media library.

    Even when I manually define the alt text for an image when creating the gallery it’s not appearing in the final html.

    Surely if I don’t manually define the alt text in modula it should pull the original alt text like it does with the caption field?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Robin

    (@robin-ho)

    Edit: Okay, the alt seems to show up on the thumbnail image using the Magnific popup, but not in the lightbox.

    Any it only shows up if I manually define it. I really don’t want to go through hundreds of images to duplicate the alt text when it’s already defined in the WP core library, surely this should get pulled from there?

    Hello @robin-ho,

    Thank you for reaching out to us!
    I just tested this on my end and it seems to be working ok. If the image has an ALT text defined in Media library when adding the image to a gallery it should pull that without having to add it again. Also the alt text will be add only for the thumbnail, not the image inside the lightbox. I’ve opened a ticket regarding this and we will investigate and see if it can be added for a future update.

    Can you please let me know what version # of the plugin do you have installed?
    Also can you please send me the url of the page in question? The one with the gallery.

    Warmly,
    Mihaela

    I have the same problem. When I view source code in the browser, the alt= attribute with the image anchor always comes up as alt=”sitename”. I have tried deactivating all plugins. I have tried using multiple themes including themes that are tagged as “accessibility ready”, I have tried deleting the image from the media library and re-uploading it assigning the alternative text. The problem is the same regardless.

    Sorry. I just realized that I posted this issue in the wrong place. This is an issue with WP, not with Modula. I will repost elsewhere.

    No worries, @paulfont!

    I’m not getting any alt text. Even on the thumbnail. Any reason for this? I checked settings and I don’t see an alt text option.

    UPDATE: I figured it out. But Modula should do it themselves instead of expecting us to.

    I updated this line: <img class='<?php echo esc_attr(implode( ' ', $data->img_classes )) ?>'<?php echo Modula_Helper::generate_attributes( $data->img_attributes ) ?>/> at includes > public > templates > items > item.php

    To this: <img alt='<?php get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ); ?>' class='<?php echo esc_attr(implode( ' ', $data->img_classes )) ?>'<?php echo Modula_Helper::generate_attributes( $data->img_attributes ) ?>/>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Alt text not getting pulled from WP core and not appearing in html’ is closed to new replies.