我正在处理我的 WordPress 子主题并使用高级自定义字段,但我在前端显示其中一个字段时遇到了麻烦。
<?php if( get_field('pp-full-image') ): ?>
<? // closes main .row and .container from header & inserts full width image ?>
</div><!-- .row from header -->
</div><!-- .container from header -->
<div class="pp-sub" style="background-image: url(<?php the_field('pp-full-image'); ?>)"></div>
<!-- .pp-sub -->
<? // displays section 3 content ?>
<?php $ppsec3 = get_field('pp-section3');
if( $ppsec3 ): ?>
<div class="container">
<div class="row">
<div class="pp-sec sec3">
<h3 class="pp-title sec3"><?php echo ( $ppsec3['pp-section3-title'] ); ?></h3>
<div class="pp-txt sec3">
<?php echo ( $ppsec3['pp-section3-text'] ); ?>
</div>
</div>
</div><!-- /.pp-wrapper -->
</div>
<?php endif; ?>
<? // closes section 3 content ?>
<?php endif; ?>
<? // closes full width image and section 3 content ?>
<?php
get_footer();