Adding Class to WordPress Post Thumbnail

November 27, 2014

If the desired output of the default WordPress post thumbnail is not enough you can easily adjust the PHP to output your appropriate class.

<?php
    the_post_thumbnail('post-thumbnail',
      array( 'class' => "YOUR CLASS"));
?>

More information can be found on the codex.