Home › Forums › Add-ons › Repeater Field › True false in repeater › Reply To: True false in repeater
You can’t use get_sub_field() unless you are in a have_rows() loop. https://www.advancedcustomfields.com/resources/have_rows/
This will return an array of rows
$seite = get_field('seite');
where each element of the array is a row with nested elements for each field
example representation of this value:
$seite = array(
array(
// row 1
'zusatzbutton-check' => 1, / some value for this sub field
'second-sub-field' => 'value of this field',
// etc...
),
array(
// row 2
// etc...
)
)
Have rows loop
if (have_rows('seite')) {
while (have_rows('seite')) {
the_row();
if (get_sub_field('zusatzbutton-check')) {
// show information about this row
// for more information see the link provided for have_rows()
}
}
}
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.