WordPress: Izpis oznak/kategorij za podano taksonomijio

Get the terms of the given taxonomy that are attached to the post.

<?php
/**
* Get the terms for the given taxonomy
**/
$terms = get_the_terms( get_the_ID(), 'taxonomy' ); 

/**
* Loop through $terms array
**/
if( is_array($terms) && sizeof($terms) ) {
    $x = 1;
    foreach($terms as $term) {
        $delimiter = ( $x < sizeof($terms) ) ? ', ' : '';
        echo $term->name.$delimiter;
    $x++;
    }
 }
 else {
     echo '<em style="opacity:0.7;">No terms found.</em>';
 }