小编Bri*_*ian的帖子

将the_post_thumbnail宽度设置为100%

如何设置,the_post_thumbnail以便它不使用数组的大小,但可以设置为100%宽度和自动高度:

<?php $ht_featured_img = get_option('ht_featured_img'); 
if ($ht_featured_img == "true") { ?>
    <?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { /* if post has a thumbnail */ ?>
        <div class="post-image">
            <?php the_post_thumbnail( array(1215,9999) ); ?>
        </div><!--post-image-->
    <?php } ?>
<?php } ?>
Run Code Online (Sandbox Code Playgroud)

wordpress

9
推荐指数
2
解决办法
2万
查看次数

标签 统计

wordpress ×1