Get Thumbnail Alt for gallery
-
i have this code
foreach ($attachments as $id => $attachment) { // Fetch the thumbnail (or full image, it's up to you) // $img = wp_get_attachment_image_src($id, 'medium'); // $img = wp_get_attachment_image_src($id, 'my-custom-image-size'); $img = wp_get_attachment_image_src($id, 'full'); $output .= "<li class=\"grid-item\"><a href=\"{$img[0]}\" data-lightbox=\"example-set\">\n"; $output .= "<img src=\"{$img[0]}\" width=\"{$img[1]}\" height=\"{$img[2]}\" alt=\"photograph in gallery\" />\n"; $output .= "</a></li>\n"; }
how can i change “photograph in gallery” (the alt) to the real alt of the image?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get Thumbnail Alt for gallery’ is closed to new replies.