2015-10-12 52 views

回答

0

你應該看看ACF中繼http://www.advancedcustomfields.com/resources/repeater/

它的意思做你所描述的東西。 Repeater字段充當數據表,您可以在其中定義列(子字段)並添加無限行。

<?php 

//檢查中繼器字段具有數據 行如果(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 

ENDIF;

?>

+0

謝謝。有用! :) – ninjacoder