To design the output by css class is very useful.  So when you want to design wordpress post thumbnil you have to add class to the post thumbnil. So you can add class to post thumbnil as below.

<?php the_post_thumbnail('post-thumbnail', ['class' => 'CLASS_NAME']); ?>
OR
<?php
the_post_thumbnail( 'thumbnail', array( 'class'=> 'CLASS_NAME') );
?>
 
Total Views 128, Views Today 1

2 thoughts on "How to Add Class to WordPress Post Thumbnail"

  1. wewgaming says:

    Just wanna input on few general things, The website layout is perfect, the articles is very superb : D.

  2. Great, yahoo took me stright here. thanks btw for post. Cheers!

Leave a Reply

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