How to show empty profile2 field in drupal 7

    Create custom module and add following hook to display profile2 field don't have value
    function <modulename>_field_attach_view_alter(&$output, $context) {
      if ($context['entity_type'] != 'profile2' || $context['view_mode'] != 'page') {
        return;
      }
      $profile = $context['entity'];
      $instances = _field_invoke_get_instances('profile2', $profile->type, array('default' => TRUE, 'deleted' => FALSE));
      foreach ($instances as $field_name => $instance) {
        if (empty($profile->{$field_name}) && $field_name=='<field_name> or <nocondition all fields>') {
          $display = field_get_display($instance, 'page', $profile);
          if ($display['type'] == 'hidden') {
            continue;
          }
          $field = field_info_field($field_name);
          $output[$field_name] = array(
            '#theme' => 'field',
            '#title' => $instance['label'],
            '#label_display' => 'above',
            '#field_type' => $field['type'],
            '#field_name' => $field_name,
            '#bundle' => $profile->type,
            '#object' => $profile,
            '#items' => array(),
            '#entity_type' => 'profile2',
            '#weight' => $display['weight'],
            0 => array('#markup' => '&nbsp;'),
          );
        }
      }
    }
    5
    Average: 5 (1 vote)