Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to display all of the terms for a custom taxonomy(characters), the taxonomy is related to a custom post type(books).

What I would like to do is display all of the terms for characters, so say for instance I have two books, and I add three characters to each book, I would like all six characters to display.

I would only like to get the names, not links, or in list form, if I could get a set of objects or an array that would be preferable.

Thank you.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I believe what you are looking for is the get_terms function. I found it looking at the code for wp_tag_cloud, here is the source of the function. This little snippet should get you what you are wanting.

$terms = get_terms("characters");

if ( empty( $tags ) || is_wp_error( $tags ) )
  return;

foreach ( $terms as $term ) {
  echo $term->name;
}
share|improve this answer
    
rtgibbons, when trying to use this, it breaks my site. –  WouterB Sep 16 '11 at 15:32
    
Not sure way, make sure the get_terms is getting the term of your taxonomy. If are, then open up another question, feel free to send me the link when you on twitter @rtgibbons –  Ryan Gibbons Sep 17 '11 at 1:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.