如何在最近发布的WordPress中添加缩略图

我在wordpress上使用bootstrap主题。我最近的帖子只显示标题和一小段文字, 而没有原始帖子的缩略图。

我需要最近的帖子在右侧显示一个小缩略图, 然后显示标题和小文本

这是我的代码

       <div class = "col-md-10">
            <?php while(have_posts()) : the_post(); ?>
                <div class="well well-sm">
                <h3>
                    <a href = "<?php the_permalink(); ?>"><?php the_title(); ?></a>
                </h3>
                <p>
                    <?php the_excerpt(); ?>
                </p>
                <small class="text-muted"><?php the_time('j F Y'); ?></small>
                </div>
            <?php endwhile; wp_reset_query(); ?>
        </div>

#1


假设你对帖子缩略图具有主题支持, 则只需添加以下代码即可显示特色图片缩略图:<?php the_post_thumbnail(); ?>。

要添加主题支持, 请将其添加到你的functions.php文件中:add_theme_support(‘post-thumbnails’);

来源:

https://www.srcmini02.com/65175.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_41064.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?