Title: Related posts using wp_get_object_terms
Last modified: August 20, 2016

---

# Related posts using wp_get_object_terms

 *  [nickhempsey](https://wordpress.org/support/users/nickhempsey/)
 * (@nickhempsey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/related-posts-using-wp_get_object_terms/)
 * I’m trying to figure out a way to dynamically pull in posts based off of the 
   posts attached taxonomy terms in a custom post type.
 * I have a custom post type ‘Products’ set up with a few associated custom taxonomies.
   The one I’m trying to target for this project is ‘Vendors’ (slug = product-vendor).
 * I need to figure out how to do this dynamically because there are 30 vendors 
   and they wil be adding more every once in awhile, I don’t want to do and if statement
   for every single one… or I’ll have to update the theme everytime they add a new
   vendor.
 * There will only be 1 vendor attached to each product, so I thought this would
   be the best way to get it to pull the most recent 5 products.
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * I only get a blank white page. What am I missing
 * Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/related-posts-using-wp_get_object_terms/#post-2406053)
 * Try it with something like this: [http://pastebin.com/Sx0e8SMg](http://pastebin.com/Sx0e8SMg)
 *  Thread Starter [nickhempsey](https://wordpress.org/support/users/nickhempsey/)
 * (@nickhempsey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/related-posts-using-wp_get_object_terms/#post-2406054)
 * You are a star! Worked perfectly. Thanks!
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/related-posts-using-wp_get_object_terms/#post-2406059)
 * You’re welcome. Glad you got it resolved.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Related posts using wp_get_object_terms’ is closed to new replies.

## Tags

 * [wp_get_object_terms](https://wordpress.org/support/topic-tag/wp_get_object_terms/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/related-posts-using-wp_get_object_terms/#post-2406059)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
