Home › Forums › Add-ons › Repeater Field › Options Page Repeater Row of Current Page Only › Reply To: Options Page Repeater Row of Current Page Only
Hi John,
Thanks for your help, just needed to change $post_id to get_the_ID() in your example and it worked! Yaay.
<?php
$current_post = get_the_ID();
if( have_rows('acf-colours', 'option') ):
while( have_rows('acf-colours', 'option') ) : the_row();
$post_objects = get_sub_field('pages');
if( ($post_objects) ):
foreach ($post_objects as $post_object) {
if ($post_object == $current_post) {
?> sub-menu-<?php the_sub_field( 'colour' );
} // end if current post
} // end foreach post
endif;
endwhile;
endif;
?>
Thanks again for your help.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.