how to get the values of entity reference fields of a content type in a node page? There is a content type in my website called singer and every singer may have name and some other information. there is another content type called songs and every song has two fields: (1) File (2) name. I also created an Entity Reference field in songs which links the song to a singer. obviously every singer may have any number of linked songs.

I listed the singers in a page and it must display every singer information and songs when the user click on any of the singers. this is my template.tpl.php

function MyThere_preprocess_page(&amp;$variables)
{
    if (isset($variables['node'])) 
   {
        switch ($variables['node']-&gt;type)
        {
        case "singer":
            $suggest = "page__node__singers";
            $variables['theme_hook_suggestions'][] = $suggest;
            $variables['name'] = t($variables['node']-&gt;field_singer_name['und'][0]['value']);
            break;           
        }
    }
}


I can get value of singer fields (using kpr()) but I don't know how to get the value of songs fields that are linked to a singer.

thanks
You can try this thing

// $node represents the node object
// field_songs is the field used in content type to reference field. 
$wrapper = entity_metadata_wrapper('node', $node);
$songs = $wrapper-&gt;field_songs-&gt;value();


Now in $songs you will have each songs object and you can print what ever information you want to print from it.