Home › Forums › Add-ons › Repeater Field › Troubles with true/false in repeater › Reply To: Troubles with true/false in repeater
i dont know if true/false has Problem with repeater.
try if it works when you dont use == true, to ckeck if checked like that:
if( get_sub_field ('show_desktop') ) {
...
} else {
...
}
if this also dont work, you could try to replace true/false with a
Radio Button or Check-Box field with value “yes” (and “no” when you use radio-button) and use code like that.
$show_desktop = get_sub_field ('show_desktop');
if ($show_desktop == 'yes'){
...
} else {
...
}
of course you can replace yes/no with any value you wish when you use radio-button/check-box, just adapt code above
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.