I’m using post thumbnails to link to a page.
Is it possible to add a class name to the post thumbnail image.
<li><a href="https://wordpress.stackexchange.com/questions/102158/<?php the_permalink(); ?>" ><?php the_post_thumbnail(); ?></a></li>
I’m using post thumbnails to link to a page.
Is it possible to add a class name to the post thumbnail image.
<li><a href="https://wordpress.stackexchange.com/questions/102158/<?php the_permalink(); ?>" ><?php the_post_thumbnail(); ?></a></li>
Yep – you can pass the class you want to use to the_post_thumbnail()
as part of the attributes argument, for example <?php the_post_thumbnail('thumbnail', array('class' => 'your-class-name')); ?>
Ref: http://codex.wordpress.org/Function_Reference/the_post_thumbnail#Styling_Post_Thumbnails