I'm using this, which pulls the parent and the child:
<?php
// Get terms for post
$terms = get_the_terms( $post->ID , 'subject' );
// Loop over each item since it's an array
foreach( $terms as $term ) {
// Print the name method from $term which is an OBJECT
print $term->name . ' . ';
// Get rid of the other data stored in the object, since it's not needed
unset($term);
}
?>
Is there some way to modify this code to only retrieve the child or a better way to do this?