Home Forums Add-ons Repeater Field Post Object in Repeater Field Reply To: Post Object in Repeater Field

  • Nevermind, just had to dig a little deeper… answer for those searching…

    <?php if( have_rows('quick-links') ): ?>
        <?php while( have_rows('quick-links') ): the_row(); ?>
            <?php $post_object = get_sub_field('quick-link'); ?>
            <?php if( $post_object ): ?>
                <?php // override $post
                $post = $post_object;
                setup_postdata( $post );
                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
                <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
            <?php endif; ?>
        <?php endwhile; ?>
    <?php endif; ?>