I have created three custom taxonomies that categorize my post types by project-client
, project-brand
, & project-medium
. As of now I can use the get_the_terms()
function to return only one taxonomy successfully, project-client
.
Is there a way to use get_the_terms()
to show taxonomies from all three custom taxonomies or is a different function needed such as get_terms()
?
My code as it stands:
<?php
$project_attrs = get_the_terms( $post->ID, 'project-client' );
if (!empty($project_attrs)){ ?>
<ul class="meta">
<?php
foreach($project_attrs as $attr){
echo '<li>' . $attr->name . ' ' . '/' . '</li>';
}
?>
</ul>
<?php } ?>
The function is successful at displaying my requested taxonomy, just would like to know how to display all taxonomies from multiple custom taxonomies.
get_taxonomies()
, then loop over that to get all the terms from all the taxonomies.