Support » Plugin: Tiled Gallery Carousel Without JetPack » Restore alt attribute text to image gallery

  • Suggestion if an update every becomes available to implement this, but for everyone else who wants to know how to restore alt attributes, here it is. This ONLY restores it on the tiled gallery, not on the actual carousel image. I’ll get to that eventually. 😉

    Edit the plugin.

    Edit tiled-gallery.php

    Under line 259 ($image_title) add:

    $image_alt = get_post_meta($image->ID, '_wp_attachment_image_alt', true);

    Then add around like 265…

    alt="' . esc_attr( $image_alt ) . '" />

    To the output.

    Should look like:

    $output .= '<div class="tiled-gallery-item tiled-gallery-item-' . esc_attr( $size ) . '"><a href="' . esc_url( $link ) . '"><img ' . $this->generate_carousel_image_args( $image ) . ' src="' . esc_url( $img_src['url'] ) . '" width="' . esc_attr( $image->width ) . '" height="' . esc_attr( $image->height ) . '" align="left" title="' . esc_attr( $image_title ) . '" alt="' . esc_attr( $image_alt ) . '" /></a>';

Viewing 1 replies (of 1 total)
  • Thank you. Will try and implement that later today. Hopefully, plugin author will update plugin soon, incorporating this.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.