• Hello,

    for my template, I need to loop through the posts and solely output the posts’ thumbnails. Aswell, I have to make use of the post-format classes (.format-video, .format-gallery, etc.), but I don’t know, how to add a post’s classes to the thumbnail.

    There is the function <?php post_class(); ?>, but this outputs the whole string “class=’.hentry .format-video…’ “. When I want to add a class to the thumbnail with

    <?php the_post_thumbnail( ‘full-size’, array ( ‘class’ => ‘thumbnail-class’ ) ); ?>

    I can not use <?php post_class(); ?>.

    Any recommondations for that?

    In the end I’d need something like <img src=”source” class=”format-name”>.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add post's classes to thumbnail img’ is closed to new replies.