Home › Forums › ACF PRO › Creating a Single Pages/Posts from Repeater Field Rows › Reply To: Creating a Single Pages/Posts from Repeater Field Rows
Hi John,
Thanks for getting back to me.
I haven’t had any luck with the using the function to test the parameter. I get a white screen when I incorporate it in my code.
I’ve streamlined my original down for testing:
<div class="container">
<?php if( have_rows('product') ): $i = 0; ?>
<?php while( have_rows('product') ): the_row(); $i++; ?>
<h1>Repeater - <?php echo $i; ?></h1>
<?php endwhile; ?>
<?php endif; ?>
</div>
I’ve tried a number of combinations for using $_GET with my code but haven’t gotten anywhere. Below is my most recent attempt.
<div>
<?php
if (!isset($_GET['product'])) {
// show just one product
if( have_rows('product') ): $i = 0; {
while( have_rows('product') ): the_row(); $i++;
echo '<h1>Repeater - ' . $i'</h1>' ;
endwhile;
}
endif;
} else {
echo '<a href="${current_page_url}?product={$url_safe_product_name}">View Product</a>';
}
endif;
?>
</div>
Thanks again for taking the time to help with this it’s much appreciated.
Ger
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.