Home › Forums › Add-ons › Repeater Field › Trying to retrieve page objects in repeater › Reply To: Trying to retrieve page objects in repeater
Ahhhh…I seem to have gotten it to work now. Your help was invaluable. Thanks you!
if( have_rows('home', 'option') ):
while ( have_rows('home', 'option') ) : the_row();
$post_object = get_sub_field('choose_pages');
if( $post_object ):
$post = $post_object;
setup_postdata( $post ); ?>
<article class="px-content" id="chapter<?php echo the_ID(); ?>">
<div class="px-inner">
<div class="container-fluid">
<div class="row">
<div class="headline">
<h1><?php echo get_the_title($post->ID); ?></h1>
<p>content</p>
</div>
</div>
</div>
</div>
</article>
<?php wp_reset_postdata();
endif;
endwhile;
endif;
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.