小编And*_*son的帖子

Bootstrap中有响应的帖子缩略图?

我正在使用bootstrap并希望将img-responsiveimg-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)

twitter-bootstrap twitter-bootstrap-3

2
推荐指数
1
解决办法
5446
查看次数