The image alt tag shows the post title in the source instead of the Alt Text.
function my_custom_image_sizes() {
add_image_size('homepage-thumb', 329, 185, true);
}
add_action('after_setup_theme', 'my_custom_image_sizes');
function my_custom_thumbnails($html, $post_id, $post_image_id, $size, $attr) {
if(is_home() && $size == 'large') {
$size = 'homepage-thumb';
} elseif(is_single() && $size == 'large') {
$size = 'postpage-thumb';
}
$image = wp_get_attachment_image_src($post_image_id, $size);
if ($image) {
$html = '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . get_the_title($post_id) . '">';
}
return $html;
}
add_filter('post_thumbnail_html', 'my_custom_thumbnails', 10, 5);
I just want the alt text that I put in the image section.