Change logo based on taxonomy term
You can make the code work in 2 situations.

$term = menu_get_object('taxonomy_term', 2);
if (empty($term)) {
  if ($node = menu_get_object('node', 1) ) {
    $wrapper = entity_metadata_wrapper('node', $node);
    $term = $wrapper-&gt;field_organisation-&gt;value();
  }
}

if ($term) {
  $title = $term-&gt;name;
  $title = str_replace(' ', '', $title);
}


entity_metadata_wrapper() is the function provided by module Entity