I found a way to get all the terms that I want.
query_posts( array ('post_type' => 'photo', 'photo_ano' => '2011', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => -1) );
while ( have_posts() ) : the_post();
$postterms = get_the_terms( $post->ID, 'photo_tags' );
if ($postterms) {
foreach($postterms as $term) {
$all_terms[] = $term->name;
}
}
endwhile;
$terms = array_unique($all_terms);
foreach ($terms as $term) {
echo '<li><a href="#'.$term->slug.'" class="foto-filter-button '.$term->slug.'">'.$term.'</a></li>';
}
but, this solution gives me a one dimensional array, because of the $all_terms[] = $term->name; piece of code.
so, I can’t get the slug, just the name of the term.
is that a way to put two values (name and slug) in that array so I can print out these values separated?