Only display field and label if value exists

formatted.php

<?php
	$company_description = get_company_field( 'company_description' ); 
	if( $company_description ):
?>
<h4><?php _e( 'About Us', 'petsitter' ); ?></h4>
<?php 

	echo $company_description;
	endif;
?>

minimal.php

<?php $company_description = get_company_field( 'company_description' ); if( $company_description ):?>
<h4><?php _e( 'About Us', 'petsitter' ); ?></h4>
<?php echo $company_description; endif; ?>
No comments yet.

Leave a Reply