Home › Forums › General Issues › ACF Repeater: No posts › Reply To: ACF Repeater: No posts
Hi @toad78
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?
Thanks!
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.