Forums

Related posts using wp_get_object_terms (4 posts)

  1. nickhempsey
    Member
    Posted 6 months ago #

    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. Please use the pastebin]

    I only get a blank white page. What am I missing

    Any thoughts?

  2. keesiemeijer
    moderator
    Posted 6 months ago #

    Try it with something like this: http://pastebin.com/Sx0e8SMg

  3. nickhempsey
    Member
    Posted 6 months ago #

    You are a star! Worked perfectly. Thanks!

  4. keesiemeijer
    moderator
    Posted 6 months ago #

    You're welcome. Glad you got it resolved.

Reply

You must log in to post.

About this Topic