Adding ALT attribute to thumbnail image
-
Noticed there isn’t any ALT attribute added to the thumbnail image. I tried the sdm_download_fancy_2_thumbnail hook, as shown below, but ALT= doesn’t proceed any text.
// Simple Download Monitor: Add ALT attribute to download fancy 2 thumbnail if ( is_plugin_active('simple-download-monitor/main.php') ) { add_filter('sdm_download_fancy_2_thumbnail', function($thumb_output, $args) { $download_id = $args['id']; $download_thumb_url = get_post_meta($download_id, 'sdm_upload_thumbnail', true); $download_thumb_alt = get_post_meta($download_id, '_wp_attachment_image_alt', true); $thumb_output = '<img src="' . $download_thumb_url . '" alt="' . $download_thumb_alt . '" />'; return $thumb_output; }, 10, 2); }
May I know what is amiss, please? Thank you.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Adding ALT attribute to thumbnail image’ is closed to new replies.