Home › Forums › Add-ons › Repeater Field › Why would the loop suddenly start acting wonky? › Reply To: Why would the loop suddenly start acting wonky?
Nevermind. It was yet another late night when I should have stopped working hours earlier and my brain was fried. Truly, I’m not sure what had happened. I hadn’t changed the code from when it had been working. But I just went and re-did it and it’s clearly different. Works fine now.
If anyone else needs it, even though I’d already technically had this answered in a post a few days ago (see? I said I was tired. I didn’t even remember that until this morning):
<nav>
<a href="#introduction" class="inactive"><i class="fa fa-home fa-2x"></i><span>Home</span></a>
<?php if( have_rows('home', 'option') ): $i = 0;
while ( have_rows('home', 'option') ) : the_row();
$post_object = get_sub_field('choose_pages');
$post_icon = get_sub_field('choose_icon');
if( $post_object ):
$post = $post_object;
setup_postdata( $post );
$i++; ?>
<a href="/?chapter=<?php echo $i; ?>" id="link_<?php echo get_the_title( $p->ID ); ?>">
<i class="fa <?php echo $post_icon; ?> fa-2x"></i>
<span><?php echo get_the_title($post->ID); ?></span>
</a>
<?php wp_reset_postdata();
endif;
endwhile;
endif; ?>
<div class="clearfix"></div>
<div class="nav2">
<?php wp_nav_menu( array( 'theme_location' => 'user' ) ); ?>
</div>
</nav>
And now everything is hunky dory again. SMH. Just shoot me now.
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.