我在网站上使用ACF插件。假设在一篇博文中,我想添加多个外部链接,并且我希望每个链接都具有可配置的显示文本,而不是永久链接。使用ACF对单个外部链接执行此操作并不难,但我无法弄清楚如何对同一篇文章中的多个外部链接执行此操作。
您应该查看ACF转发器http://www.advancedcustomfields.com/resources/repeater/
它的意思是按照您的描述进行操作。Repeater字段用作数据表,您可以在其中定义列(子字段)并添加无限行。
<?php
//检查转发器字段是否具有数据行if(have_rows('repeater_field_name')):
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
the_sub_field('sub_field_name');
endwhile;
别的 :
// no rows found
万一;
?>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句