I'm trying to use get_the_term_list to catch the name of the current taxonomy of the page, and then use it with get_terms and a foreach method, to show the result of all the "elements" from the same taxonomy, but i only got an empty result. (for example, this is to have the related articles of the page).
Do you know why it doesn't work? The echo on get_the_term_list works ok, but then in the parameter of get_terms, the result of the "li"s is blank.
$my_tax = get_the_term_list( $post->ID, 'type');
//echo $my_tax;?> output works fine
$terms = get_terms($my_tax);
foreach ($terms as $term) {
echo "<li>".$term->name."</li>"; // empty
}
Could you help me?