php - Wordpress 高级自定义字段未显示在前端
问题描述
我正在研究我的 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();
解决方案
推荐阅读
- c# - C#处理EASYMODBUS时Socket是否连接
- android - 如何处理错误:链接引用失败
- javascript - 为什么此代码返回 3 维数组
- c++ - 有没有办法在数学上解决 UVA 417?
- java - Android 广播接收器的问题
- c# - 如何检查奖励广告是否可用?
- angular - 关闭垫子对话框后如何将返回值发送给 CanDeactivate Guard | Angular CanDeactivate Guard | 角度材料对话框
- android - 传输到 GL 线程时,vector3f 中的数据丢失/损坏
- javascript - 获取返回 JSON 的外部 API 时出现问题
- java - 大型阵列反序列化期间的性能下降