repeater(繰り返しフィールド)の出力
<?php
if( have_rows("フィールド名") ):
while ( have_rows("フィールド名") ) : the_row();
the_sub_field('サブフィールド名');
endwhile;
endif;
?>
repeaterフィールドの中から10件出力
<?php
$i = 0;
if( have_rows('フィールド名') ):
while( have_rows('フィールド名') ): the_row();
$i++;
if( $i > 10 ) {
break;
}
the_sub_field('サブフィールド名');
endwhile;
endif;
?>
コメント