Home › Forums › General Issues › ACF Repeater: No posts › Reply To: ACF Repeater: No posts
Your code looks great for me. Did you put it outside of The Loop? If you did, you need to pass the post ID as the second parameter of the have_rows() function. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/have_rows/. So, it should be something like this:
<?php if( have_rows('partsno', '99') ): ?> <?php while( have_rows('partsno', '99') ): the_row(); ?>
Where ’99’ is the ID of the post that has the repeater field.
If it doesn’t work, could you please share the JSON or XML export of the field group and the complete PHP template file where you put that code?
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!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.