How do I get the field label? I added some fields to the "Article" content type. I want to output them in a page--front.tpl.php. How do I get the field label value?

When I use the following code in page--front.tpl.php, it doesn't show the name of the field label. Why? What code should I use to print the field label?

$node = node_load(1);
print_r($node);


The output is similar to the following: 


    [field_sq] => Array(
      [zh-hans] => Array(
        [0] => Array(
          [value] => 250
        )
      )
    )
In node-article.tpl.php  add this code at the beginning

// loop through node properties
foreach ($node as $k =&gt; $v) {
  // ensure this property is a field
  if (substr($k,0,6) == 'field_') {
    // use the CCK function to get the field data for this field
    $fieldData = content_fields($k, $node-&gt;type);

    // add the label to the array
    $fieldLabels[$k] = $fieldData['widget']['label'];
  }
}


Than you can print labels like this: 

&lt;?php if ($node-&gt;field_YourField[0]['view']){ ?&gt;

    &lt;?php print $fieldLabels['field_YourField']; ?&gt; // prints label (add div/span wrapper if you need it)

    &lt;?php print $node-&gt;field_YourField[0]['view'] ?&gt; // prints field value (add div/span wrpaer if you need it)

&lt;?php } ?&gt;


This is tested in Drupal 6.
Hope it helps.