私はWordpressでACF(高度なカスタムフィールド)を使用しています。表示する列は約40行ですが、5行目から開始したいと考えています。基本的には、1行目ではなく40行目に5行目を表示したいとします。これを行う方法はありますか?私のコードは以下の通りです。Wordpress Advanced Custom Fields(ACF)を使用して特定の行を開始する方法はありますか?
あなたはこのように、この使用してコードを達成することができるはず <?php
if(have_rows('repeat_field')):
$i = 0;
// loop through the rows of data
while (have_rows('repeat_field')) : the_row();
$i++;
if (!empty(get_sub_field('feature_image_post'))) {
the_sub_field('feature_article_link');
the_sub_field('feature_image_post');
the_sub_field('feature_title');
}
if($i > 40)
{
break;
}
endwhile;
else :
// no rows found
endif;
?>
ありがとうございます。これはちょうど私が探していたものでした! – Mariton
あなたは大歓迎です! –