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!
Our guide looks into WordPress custom fields and how they stack up against the possibilities of ACF.
— Advanced Custom Fields (@wp_acf) July 18, 2022
https://t.co/hk3yibkHyk
© 2022 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.