【发布时间】:2015-08-05 17:28:13
【问题描述】:
在 wordpress 中,我使用 Advanced Custom Fields 插件创建自定义字段,并且我试图将所见即所得编辑器放在转发器字段中。
这是我的代码:
<? $args = array('post_type' => 'rates',);?>
<?php query_posts($args); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $rates_col=get_field('rates'); ?>
<? foreach( $rates_col as $rates_col_item){ ?>
<div class="rate-item">
<?php the_field('wysiwyg'); ?>
</div>
<? } ?>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query() ?>
其中rates 是转发器名称,wysiwyg 是所见即所得编辑器子字段名称。转发器字段正在工作,如果我有多个转发器行,则 <div class="rate-item"> 重复以匹配它。但是我没有看到我在编辑器中写的任何内容。我的错在哪里?
【问题讨论】:
标签: php wordpress advanced-custom-fields