Adding Class to WordPress Post Thumbnail

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.


This entry was posted in Uncategorized and tagged .

This post currently has no responses. What do you think?

You can use basic HTML when posting code, please turn all < characters into &lt; or > into &gt;
If the code is multi-line, use <pre><code></code></pre>

Leave a Reply

Your email address will not be published. Required fields are marked *