I'm a bit confused.
I have an array:
<?php
$terms = get_the_terms($post->ID, 'pf');
print_r($terms);
?>
And it outputs:
Array ( [15] => stdClass Object ( [term_id] => 15 [name] => Text [slug] => text [term_group] => 0 [term_taxonomy_id] => 33 [taxonomy] => pf [description] => An PF article. [parent] => 0 [count] => 3 [object_id] => 694 ) )
And I want just to output slug ("text" in this case) instead of the whole array.
So I'm doing:
<?php $terms = get_the_terms($post->ID, 'pf');
echo $terms["slug"]; ?>
And it outputs nothing.
This gives no results as well:
echo "{$terms['slug']}";
Any ideas?
UPDATED!!!
I can't use $term[15]->slug since my script will be based on [taxonomy] (pf in this case)! :) So it's impossible to do that without foreach loop?