您可以将自定义字段添加到团队页面,将其称为“second\\u picture”或任何您想要的内容,然后添加代码
<div class="box">
<div class="rounded-circle" style="background-image:url(\'<?php the_post_thumbnail_url(\'full\'); ?>\')" id="staff-pic">
<div class="second-picture" style="background-image:url(<?php the_field(\'second_picture\'); ?>)"></div>
</div>
<h3 class="team-name"><?php the_title(); ?></h3>
<p class="description text-center"><?php echo get_the_content(); ?></p>
<div class="social"><a href="#"><i class="fab fa-facebook"></i></a><a href="#"><i class="fab fa-twitter"></i></a><a href="#"><i class="fab fa-instagram"></i></a></div>
</div>
然后设置悬停状态
.second-picture{
width:100%;
height:100%;
background-size:cover;
background-position:center;
opacity:0;
transition:.2s;
}
.second-picture:hover{
opacity:1;
}