So I added the_post_thumbnail(); so I can add images through the featured image area in the wordpress.

I am trying to add schema to the output since it isn't working by just wrapping the_post_thumbnail(); in a span.

I am curious where the html output is defined in the files?

1 Answer 1


Use the filter post_thumbnail_html (source):

function wpse_195454_post_thumbnail_html( $html ) {
    if ( $html )
        $html = '<span class="wrap">' . $html . '</span>';
    return $html;

add_filter( 'post_thumbnail_html', 'wpse_195454_post_thumbnail_html' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.