Display custom fields only if it has a value
You can use isset() function to check if it has a value. In your case you can do like this : $width = get_post_meta( $post->ID, ‘iswidth’, true ); if( isset( $width ) ){ echo “<li>Width (px): “.$width.”</li>”; }