Last Updated: February 25, 2016
·
4.322K
· stanwarri

Add css class to wordpress thumbnails

Just in case you are working on some image effects with wordpress thumbnails and you want to be able to apply a css class to the image tag, here is what you can do.

<?php the_post_thumbnail('custom-thumbnail', array('class'=>"css-class-name")); ?>

//css style
css-class-name{
  border: 1px solid #90TH76;
 }

Hope you would find it useful.