【问题标题】:ACF field content not retrieving in Wordpress MultisiteACF 字段内容未在 Wordpress 多站点中检索
【发布时间】:2015-12-26 12:15:18
【问题描述】:

我在 Wordpress 多站点模板中使用 ACF 转发器字段。管理面板中显示的字段,我可以使用后端添加内容。但是那些数据没有显示在前端。这是我检索数据的代码。

<?php if(get_field('history')): ?>

<?php while(has_sub_field('history')): ?>
    <div class="col-lg-3 history">
        <h3><?php the_sub_field('year'); ?></h3>
        <div class="description"><p><?php the_sub_field('description'); ?></p></div>
    </div>
<?php endwhile; ?>

我有 3 个网站。

  1. /xx
  2. /xx
  3. /xx

如何在前端显示数据..?

【问题讨论】:

    标签: repeater advanced-custom-fields multisite


    【解决方案1】:

    我认为您的 if 语句不正确。它应该准备好了if(get_sub_field('history')):

    【讨论】:

      猜你喜欢
      • 2017-02-02
      • 2018-12-13
      • 2017-12-22
      • 2018-05-31
      • 1970-01-01
      • 1970-01-01
      • 2021-11-23
      • 2019-08-08
      • 2014-04-18
      相关资源
      最近更新 更多