Home › Forums › Add-ons › Flexible Content Field › Flexible Content – Map – functions.php › Reply To: Flexible Content – Map – functions.php
Yes, Once you are already inside a loop on a repeater (a flex field is also a repeater) you no longer need to supply a post ID.
if (have_rows('flex-field-name', $post_id)) {
while (have_rows('flex-field-name', $post_id)) {
the_row();
// you no longer need to provide the post ID
// nested repeater
if (have_rows('locations')) {
while (have_rows('locations')) {
the_row();
// etc....
}
}
}
}
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.