Php 使用wordpress将4张带有\u post\u缩略图()图像的卡片拉伸到合适的位置?

Php 使用wordpress将4张带有\u post\u缩略图()图像的卡片拉伸到合适的位置?,php,image,wordpress-theming,bootstrap-4,Php,Image,Wordpress Theming,Bootstrap 4,我正在尝试拉伸功能图像以适合引导卡。卡对齐并正确响应,但图像到处都是 <section class="container"><!-- container - 3 --><p class="text-white">.</p> <div class="row"> <article class="col-sm-12 col-md-4 mb-4 "> &

我正在尝试拉伸功能图像以适合引导卡。卡对齐并正确响应,但图像到处都是

    <section class="container"><!-- container - 3 --><p class="text-white">.</p>
        <div class="row">
            <article class="col-sm-12 col-md-4 mb-4 ">
                <div class="card">
                    <?php  if(have_posts()) : ?>
                    <?php $i = 4; while (have_posts() && $i < 5) : the_post(); ?>
                    <?php if(has_post_thumbnail()): ?>
                    <?php the_post_thumbnail( 'small','style=max-width:150%;height:auto;'); ?>
                    <?php endif;?>
                            <!-- <a href="<?php //the_permalink(); ?>"> -->
                            <div class="sub-Article text-center card-title"><?php the_title();?>
                            <!-- </a> -->
                    <p>Article - <span class="font-weight-normal small"><?php the_time('F j, Y g:i:a');?></span></div>
                            <!-- <p class="Main-Article"><?php //the_title(); ?></p> -->
                            <!-- <a class="button btn-primary btn-lg text-left" href="<?php //the_permalink(); ?>">
                             Selengkapnya ></a></span> -->
                    <?php $i++;  endwhile; ?>
                    <?php  else : ?>
                    <?php  echo wpautop('Sorry no posts were found'); ?>
                    <?php endif; ?>
                </div>
            </article>
        </row>
     </section>

具有讽刺意味的是,Wordpress后端cms中显示的功能图像,在wp管理员中登录,可以完美地工作

好吧,我知道这不应该起作用,但它确实起作用了!在玩了图像的东西之后,我发现只需添加
谢谢,但我没有使用标签。它们不使用\u post\u缩略图()。我试着通过一个div使用img fluid,但是没有效果。你需要发布你的输出HTML,因为这与PHP无关,PHP代码对于调试这种性质的问题是无用的。这会有什么帮助。我可以修复html中的错误。正如我所说,我已经用标准html编写了一个非常好的工作程序。这是我需要了解的,当我动态地将图像引入时,如何让图像覆盖卡片的背景。我会自己解决的。。。
.sub-Article{
    margin-top:-160px;
    background-color:white;
    opacity:0.5;
    padding: 30px 30px 35px 30px
}
<img class="style"<?php if(has_post_thumbnail()): ?>