Support

Account

Home Forums General Issues Hide area if field is empty

Helping

Hide area if field is empty

  • Dear from Germany.

    I´m not a PHP pro and thatswhy I need help with the code.

    I built a frontend template and show my ACF´s there. Now I want to hide/toogle the whole DIV (from first div to last div) if the first field (stage_1_ps) is empty. I think it will be not difficult but I cannot find a solution.

    <div class="vc_progress_bar wpb_content_element pb-style-one default-bg dt-style"><h2 class="wpb_heading wpb_progress_bar_heading">Serie</h2><div class="vc_general vc_single_bar vc_progress-bar-color-bar_black"><small class="vc_label"><?php $value = get_field( "stage_1_ps" );
    if( $value ) { 
        echo $value;
    } else {
        echo ' - ';  
    }?> | <?php $value = get_field( "stage_1_nm" );
    if( $value ) { 
        echo $value;
    } else {
        echo ' - ';  
    }?></small><span class="vc_bar " data-percentage-value="80" data-value="80" style="width: 80%;"></span></div></div>
  • I found a solution in this forum by using the search.

    My topic is solved

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Hide area if field is empty’ is closed to new replies.