我正在使用bootstrap
并希望将img-responsive
和img-circle
类应用于后缩略图.
问题是我不知道如何使图像缩略图的PHP代码在img标记内工作.
除非我可以标记它们,否则我不能应用类,并且div标签不起作用.
我确信它很简单,但会欣赏指针.
代码在这里 - 目前我已经在div标签中尝试了它,它获取图像但不适用于样式
<h4>Latest News</h4>
<?php $counter = 3;
$recentPosts = new WP_Query();
$recentPosts->query('showposts=3');?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<div>
<span class="glyphicon glyphicon-star"></span>
<div class="img-responsive img-circle"> <?php the_post_thumbnail(); ?> </div>
<p class="posttitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<p class="smallprint"><?php the_date(); ?></p>
<div><?php the_excerpt(10); ?></div>
</div>
<?php endwhile; ?>
Run Code Online (Sandbox Code Playgroud)