Get the top taxonomy parent info ( Drupal 7 )

  • Posted on: 22 December 2016
  • By: jmu

taxonomy_get_parents_all($tid) 

     Find all ancestors of a given term ID.

$node = node_load($node_id);
$tag=(array_pop(taxonomy_get_parents_all($node->field_tag['und'][0]['tid'])));
$tagParent= $tag->name;
English