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):

    	<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>
    	<?php wp_reset_postdata();
    		endif; ?>
    		<div class="clearfix"></div>
    		<div class="nav2">
    			<?php wp_nav_menu( array( 'theme_location' => 'user' ) ); ?>

    And now everything is hunky dory again. SMH. Just shoot me now.