我可以在第一个例子中使用非重复字段,但是在第二个使用重复字段的例子中,我不能让wpauto函数工作。
<?php echo "<strong>Paragraph</strong>".wpautop($meta['paragraph']).""; ?>这是我得到的最接近的..。在wpautop打印之前,我知道函数的第一部分,而wpautop到目前为止几乎什么也没做。
<?php
global $index_accordian_repeat;
?>
<?php if($index_accordian_repeat->have_value('panels')):?>
<dl class="accordion">
<?php while( $index_accordian_repeat->have_fields('panels') ) : ?>
<!--title --><dt><a href=""><?php $index_accordian_repeat->the_value('header'); ?></a></dt>
<!--link --><dd><?php $index_accordian_repeat->the_value('link'); ?><br />
<!--content --><?php $my_meta = $index_accordian_repeat->the_value('');
echo wpautop($my_meta['content']); ?></dd>
<?php endwhile; ?>
</dl>
<?php endif; ?>发布于 2012-07-18 23:44:03
这不是最简单的答案吗?我请求the_value,它将打印它,然后我以另一种方式请求,它只给了我一个数组。但这就是它起作用的原因。
<?php $content = $index_accordian_repeat->get_the_value('content');?> <?php echo wpautop($content); ?>我需要返回值,而不是打印它,然后获取该值并回显它。呼!
https://stackoverflow.com/questions/11532093
复制相似问题