【发布时间】:2016-01-15 04:27:25
【问题描述】:
我在 Wordpress 中使用带有中继器插件的 ACF 插件,通常在 archive.php 中我可以使用 get_field 或 the_field 函数,这些函数显示帖子的数据。 (例如:标题)
在single.php中没有问题,当我想在archive.php中使用the_sub_field或get_sub_field时,
在archive.php 中,下面的示例显示我没有单词。我怎样才能看到“是”字?我该怎么办?谢谢。
<?php
if( have_rows('add_content') ):
echo "Yes";
else :
echo "No";
endif;
?>
【问题讨论】:
-
没有中继器...(如果没有 add_content 它会拒绝)。
-
帖子有 add_content 数据,但在存档页面中,我无法获取。
标签: wordpress repeater advanced-custom-fields