Print out NID of entity reference I have a custom field that is an entity reference, when using


  print render($content['field_call_to_action_1']);


in a content type template it prints out the title Call to Action 1, and the Title of the content that the entity reference is linked too.

How can I just get it to print out the NID instead?

Thanks for your time!
$content is to be rendered and obeys what you have set in node(other other entity) type's Display Settings (Administer > Structure >Content Types). 

What you should use is, $node object. 

&lt;pre&gt;
&lt;?php
print_r($node);
?&gt;
&lt;/pre&gt;


Now you will see a nicely formatted information of $node object which also has the NID you want. 

You will be able to access it with this:

$node-&gt;field_call_to_action_1['und'][0]['target_id']


Quick hint:If you are trying to build a URL link from this value, have a look at url() and l() functions!