0

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

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, privacy policy and cookie policy

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