How can I get all related entities of a node programmatically?
Like this, you will get all the referenced items of the node being displayed.

  $current_path = explode('/', $_GET['q']);
  if ($current_path[0] == 'node' &amp;&amp; is_numeric($nid = $current_path[1])) {
    $field = 'my_field';
    $bundle = 'my_bundle';
    $query = db_query("SELECT {$field}_target_id FROM field_data_{$field} WHERE entity_id = :nid AND bundle = :bundle",
      array(
        ':nid' =&gt; $nid,
        ':bundle' =&gt; $bundle,
      )
    );
    foreach($query as $row) {
      $target_ids[] = $row-&gt;{$field . "_target_id"};
    }
    $nodes = node_load_multiple($target_ids);
  }


If you have more entity reference fields, you have to expand the query (with more joins) according to your fields.