I have tried to apply filters to the_post_thumbnail() function using
apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr );
Here’s the code I have come up with but doesn’t seem to work completely
function red_adjust_image_schema($html, $id, $caption, $title, $align, $url, $size, $alt)
{
$html="<div class="image-container" itemprop="image">". $html . '</div>';
return $html;
}
add_filter('post_thumbnail_html', 'red_adjust_image_schema', 20, 8);
How can I add itemprop=”image” to the actual image element so it registers properly? Right now it seem like I can only do a container and wrap around $html?
Thanks