use get_the_terms
instead and exclude any terms where parent value is 0
, which means it is a top-level term.
$terms = get_the_terms( $post->ID, 'portfolio-type' );
if ( !empty( $terms ) ) {
$output = array();
foreach ( $terms as $term ){
if( 0 != $term->parent )
$output[] = '<a href="' . get_term_link( $term ) .'">' . $term->name . '</a>';
}
if( count( $output ) )
echo '<p><b>' . __('Categories:','om_theme') . '</b> ' . join( ", ", $output ) . '</p>';
}