Support

Account

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>';
    		}
    
    ?>