<div class="section3">
<?php if( have_rows('section3') ): ?>
<?php while( have_rows('section3') ): the_row();
// vars
$image = get_sub_field('image');
$title = get_sub_field('title');
$caption = get_sub_field('caption');
$link_text = get_sub_field('link_text');
$link = get_sub_field('link');
?>
<div class="container">
<div data-aos="fade-left">
<div class="section3-top">
<div class="rotatey">
<img src="<?php echo $image; ?>" alt="">
</div>
<div class="top__right">
<h6><?php echo $title; ?></h6>
<div class="desc">
<?php echo $caption; ?>
</div>
<div class="click">
<?php if( $link ): ?>
<a href="<?php $link; ?>" class="click__a">
<img src="<?php bloginfo('template_directory');?>/assets/img/icons/right-arrow-grey.svg" alt=""
class="click__right-arrow">
<h6>View</h6>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
所有变量都正常工作,除了Html 链接标签内的 PHP链接不正确,链接是配置中的 URL。顺便说一句,我是 PHP 和 Wordpress 的新手,谢谢。