Get The First Row From A Repeater In ACF By Using Product/Post ID

Share Now

$p1_id = get_field('product_one_id');//get id
$aff_link1 = get_field('affiliate_links', $p1_id );//REPEATER FIELD NAME

$aff_l1 = $aff_link1[0];
$aff_l1_link = $aff_l1['affiliate_link'];//sub-field name

<pre><?php echo $aff_l1_link; ?></pre>
Picture of Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert