How To Change The $tid to $term_name I've tried to change this code to show the term name instead of the term ID
but now no term name or term id show at all

Orginal code for term ID

function MYTHEME_preprocess_node(&amp;$vars) {   if (array_key_exists('content', $vars)) {
    $content = &amp;$vars['content'];
      if (array_key_exists('field_photo_topic', $content)) {
        foreach ($content['field_photo_topic']['#items'] as $index =&gt; $info) {
          $tid = $info['tid'];
          $content['field_photo_topic'][$index]['#href'] = 'photos/' . $tid;
        }
      }   } } 


What I changed it too

function MYTHEME_preprocess_node(&amp;$vars) {   if (array_key_exists('content', $vars)) {
    $content = &amp;$vars['content'];
      if (array_key_exists('field_photo_topic', $content)) {
        foreach ($content['field_photo_topic']['#items'] as $index =&gt; $info) {
          $term_name = $info['term_name'];
          $content['field_photo_topic'][$index]['#href'] = 'photos/' . $term_name;
        }
      }   } }


Many thanks for your help
To convert from $tid to term name, use  taxonomy_term_load() to load the object, and then access $term-&gt;name:

$term = taxonomy_term_load($tid);
$term_name = $term-&gt;name;


Your function should look like:

function MYTHEME_preprocess_node(&amp;$vars) {
  if (array_key_exists('content', $vars)) {
    $content = &amp;$vars['content'];
      if (array_key_exists('field_photo_topic', $content)) {
      foreach ($content['field_photo_topic']['#items'] as $index =&gt; $info) {
        $tid = $info['tid'];
        $term = taxonomy_term_load($tid);
        $term_name = $term-&gt;name;
        $content['field_photo_topic'][$index]['#href'] = 'photos/' . $term_name;
      }
    }
  }
}


Please note that this will only work the way you intend if you use PathAlias or similar to alias the path to be accessible by  term name instead of numeric $tid.