How to render entity reference data in field template? I have a field collection with adding multiple items. In each item there is an entity reference field with multi-selection of contents. I can render entity reference content by target_id using node_load in an entity_reference field template. But it is getting only first value of each item. 

How can I render all contents of each item from field collection? Is  there another way to fetch?
Paste the below code template.php;

function mytheme_preprocess_node(&amp;$variables) {
  if(isset($variables['node']))   {
    switch ($variables['node']-&gt;type) {
      case "value":
        $var_abc = $variables['node']-&gt;field_abc;

        foreach ($var_abc['und'] as $key =&gt; $value) {
          $variables['abc_fields'][] = $value;
        }
      break;
    }
  }
}


Paste the below code to create separate node tpl for that specific content type;

&lt;?php
foreach($variables['abc_fields'] as $key =&gt; $value) {

  $var_authorvalue = $value['node']-&gt;field_author;
  //echo "&lt;pre&gt;";
  //print_r($var_authorvalue['und'][0]['value']);
  $var_fields = $value['node'];
  print render($var_fields-&gt;title)."&lt;br/&gt;";
  print render($var_authorvalue['und'][0]['value'])."&lt;br/&gt;";

}
?&gt;


OR 

Check How can I print a field from a referenced entity in my theme?