Home › Forums › General Issues › Detect if field is hidden by conditional logic › Reply To: Detect if field is hidden by conditional logic
You could set it up like this (I think):
“display_footer” => Field Type = True/False
“footer_col_1” => Field Type = Text Area/Editor
“footer_col_2” => Field Type = Text Area/Editor
“footer_col_3” => Field Type = Text Area/Editor
With this code:
<?php
$footer = get_field('display_footer' );
if($footer)
{
$footer_col_1 = get_field('footer_col_1' );
$footer_col_2 = get_field('footer_col_2' );
$footer_col_3 = get_field('footer_col_3' );
echo '<h3>Footer</h3>';
echo '<ul>';
echo '<li>' . $$footer_col_1 . '</li>';
echo '<li>' . $$footer_col_2 . '</li>';
echo '<li>' . $$footer_col_3 . '</li>';
echo '</ul>';
}
?>
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.