hide published node's field? I want to hide one of a node's field when the node was published. I copied and renamed the node.tpl.php as node--app.tpl.php cause the node's content type's machine name is app.

I tested it by add the code at the beginning of the node--app.tpl.php file. yeah it works.

&lt;?php print $node-&gt;field__iap_dl['und'][0]['url']; ?&gt;


In order to hide the field I added one line in the existing code. 

&lt;div class="content clearfix"&lt;?php print $content_attributes; ?&gt;&gt;

&lt;?php
  // We hide the comments and links now so that we can render them later.
  hide($content['comments']);
  hide($content['links']);
  hide($content['field__ipa_dl']);    // I added!
  print render($content);
?&gt;
&lt;/div&gt;


This time it didn't work. What's wrong? I am newbie to code the Drupal.
You did not tell it to hide $node-&gt;field__iap_dl['und'][0]['url'].

The field probably did not show up in the rendered content, but it will still appear if you tell the template to print the information directly from the node object.

The simplest way to hide a field is to go to /admin/structure/types and under manage fields for the content type, mark the field as hidden.

EDIT:

Is this a cut and paste of your code? If so the fields names are different. field__iap_dl is not the same as field__ipa_dl.