Home › Forums › ACF PRO › How to hide sub fields in a field group… › Reply To: How to hide sub fields in a field group…
Very hard to tell without code, but I would probably use an output buffer, and also only output the rows of the table that have available set to yes.
ob_start();
$something_available = false; // flag to note something is available
if (have_rows('units')) {
while (have_rows('units')) {
the_row();
if (get_sub_field('available')) {
// this one is available
// output this row of the table
// and set our flag to true
$something_available = true;
} // end if available
} // end while have_rows
} // end if have_rows
$content = ob_get_clean();
if ($something_available) {
// only output if something is available
echo $content;
}
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.