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.

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
add comment

2 Answers

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
add comment
up vote 0 down vote accepted

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

http://codex.wordpress.org/Function_Reference/get_the_terms

share|improve this answer
add comment

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.