I tried this and just get the word “Array” instead of my list of [repeated] fields for that Post.
Here’s what worked: using the examples found on this page:
I created the following code that checks my repeater field for that Post and if it finds rows, list (wrapped in li tags) each row. I only have one field (subfield) per row, so my example is very basic….if your rows contain tabular-style data with more than one field per row, you’ll have to more closely follow the examples from that page.
Here’s my code that works:
<?php if( have_rows('room_types') ): ?> <ul> <?php while( have_rows('room_types') ): the_row(); ?> <li><?php the_sub_field('room_type'); ?></li> <?php endwhile; ?> </ul> <?php endif; ?>
Hopefully this will help. 🙂
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!
© 2023 Advanced Custom Fields.