What you are trying to do works for me. That is, this works when I try it:
the_post_thumbnail('post-thumbnail',array('itemprop'=> 'articleSection'));
I get the itemprop
attribute is my <img
tag. If that isn’t working for you I can only guess at why. Possibly there is a filter causing problems.
For a more global solution, the following will add that itemprop
to anything that uses the wp_get_attachment_image_attributes
filter, which the_post_thumbnail
does.
function alter_att_attributes_wpse_102551($attr) {
$attr['itemprop'] = 'articleSection';
return $attr;
}
add_filter( 'wp_get_attachment_image_attributes', 'alter_att_attributes_wpse_102551');
You may need conditions to prevent that from running as globally as it will left as it is.