To fetch the archive url for that taxonomy term, use something like this (I’m using your naming conventions above, and assuming that $theZielgruppe
is a term object.
$url = get_term_link( $theZielgruppe, 'ge_zielgruppe_taxonomy' );
To get the name, just use
$theZielgruppe->name
Is that what you’re looking for?
EDIT
The link above would then look like this:
<a href="https://wordpress.stackexchange.com/questions/14323/<?php echo get_term_link( $theZielgruppe,"ge_zielgruppe_taxonomy' ); ?>" rel="bookmark" title="More posts for <?php echo $theZielgruppe->name; ?>; ">More posts for <?php echo $theZielgruppe->name; ?></a>
EDIT 2
wp_get_object_terms()
returns an array of terms. If you changed each use of $theZielgruppe
to $theZielgruppe[0]
to use the first term that the current ge_zielgruppe
relates to. A warning, though: wp_get_object_terms()
can return as either an empty array or as a WP_Error
. You might want to change your code to check for that:
<?php
$theZielgruppe = wp_get_object_terms($post->ID, 'ge_zielgruppe_taxonomy');
if( !empty( $theZielgruppe ) && !is_wp_error( $theZielgruppe ) ):
$theZielgruppe = $theZielgruppe[0];
$zielgruppe = new WP_Query(array('ge_zielgruppe_taxonomy' => $theZielgruppe->slug));
$zielgruppe->query('showposts=10');
if ($zielgruppe->have_posts()) :
while ($zielgruppe->have_posts()) :
$zielgruppe->the_post();
?>
<<--archive-stuff-->>
<?php
endwhile;
endif;
?>
<a href="https://wordpress.stackexchange.com/questions/14323/<?php echo get_term_link( $theZielgruppe,"ge_zielgruppe_taxonomy' ); ?>" rel="bookmark" title="More posts for <?php echo $theZielgruppe->name; ?>; ">More posts for <?php echo $theZielgruppe->name; ?></a>
<?php
endif;
?>