WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

get_terms allows me to get all taxonomy values, but how do I limit this to a certain post?

I don't see anyway to feed a specific post ID to get_terms: http://codex.wordpress.org/Function_Reference/get_terms

Perhaps there is another way to achieve this?

share|improve this question
See: wordpress.stackexchange.com/questions/9414/… (ignore the question title, the answers are relevant). – t31os Feb 17 '11 at 21:34
wp_get_object_terms( $post_id, $taxonomy )

will return an array of the term objects for that post of that taxonomy. $post_id can also be an array of ids (this will return all terms attached to any post in the array), and $taxonomy can also be an array of taxonomies.

share|improve this answer
up vote 0 down vote accepted

Ahah! I need to use get_the_terms instead, as this will accept a post ID.


share|improve this answer

Your Answer


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.