How to use conditional not to print a field if empty in user profile?
Have you thought of using Entity Metadata Wrappers?

You can wrap the user profile using $user_profile_wrapper = entity_metadata_wrapper('user', $user_profile);, and then you can find out if the field has a value with:

if (isset($user_profile_wrapper-&gt;field_myfield)) {}


This should tell you if the user profile HAS the field, and then you might use:

$value = $user_profile_wrapper-&gt;field_myfleid-&gt;value();


to actually get the value and test if it's empty or not.

Sources:


https://www.drupal.org/documentation/entity-metadata-wrappers
Checking for existence for a field on an an entity_metadata_wrapper