Lego2012
12/13/2016 - 2:53 PM

Displaying custom fields if they exist

Displaying custom fields if they exist

<?php if ( $commercial_floor_space || $commercial_rateable_value || $commercial_lease_details ) { ?>

<div class="commercial">
    <ul class="fa-ul commercial__features">
    <?php if( $commercial_floor_space ) { ?><li><i class="fa-li fa fa-chevron-right"></i> <?php _e( 'Floor Space: ', 'textdomain' ); ?><?php echo esc_html( $commercial_floor_space ); ?> </li><?php } ?>
    <?php if( $commercial_rateable_value ) { ?><li><i class="fa-li fa fa-chevron-right"></i> <?php _e( 'Rateable Value: ', 'textdomain' ); ?><?php echo esc_html( $commercial_rateable_value ); ?></li><?php } ?>
    <?php if( $commercial_lease_details ) { ?><li><i class="fa-li fa fa-chevron-right"></i> <?php _e( 'Lease Details: ', 'textdomain' ); ?><?php echo esc_html( $commercial_lease_details ); ?></li><?php } ?>
    </ul>
</div>

<?php } ?>