Hi there,
I'm trying to find a solution for this:
I'm using custom taxonomies with a few entries (terms) and I'd like to display names and links (to term's page) by their ID. Something like
<?php echo get_category_link(id); ?>
only with terms, the same for name.
Is there a way how to do this?
Thanks
<?php echo get_the_term_list( $post->ID, 'people', 'People: ', ', ', '' ); ?>
http://codex.wordpress.org/Function_Reference/get_the_term_list
Hi, thanks for the reply, unfortunately I forgot to mention that I have to do this outside the loop with any term.
Let me explain... I need a static headline + link (separately) with term's name (headline) and term's url (link). I need to display any term by ID, for example something like <?php echo get_term_name(10); ?> would display a name of term with ID 10, the same with link.
Thanks a lot...
for url use it get_term_link( $term, $taxonomy )
Oh, where did this function come from? :O Amazing...
<?php echo get_term_link($term,$taxonomy); ?> works awesome
The only thing left is the name of the term I guess... get_term_name doesn't exists... it can be done with <?php wp_list_categories('taxonomy=...&include=id'); ?> but this includes a link to, that's a problem for me...
Thanks!
Oh, awesome, you're a genius :)
This works:
<?php $array = get_term_by('id', $id, $taxonomy, 'ARRAY_A'); ?><?php print_r($array[name]); ?>