Get Posts with Custom Taxonomy
So I’m using custom types & taxonomies on my site (great features!).
The problem I’m having is that I’m trying to get a list of posts with a certain term. I have a taxonomy-NAME.php file for the specific taxonomy, and everything is working fine except have_posts() always returns FALSE.
So then I think that maybe I need to manually query the posts with that term. According to the docs (bottom of this page) it looks like I should be able to do this with query_posts(), but when I use that syntax I get back all the posts — whether they have my term or not.
For clarity, here’s what I’m appending onto the query array:
get_query_var('taxonomy') => get_query_var('term')
…and I’ve double-checked: it’s pulling in the correct taxonomy and term name for the page. But now it returns all of the posts.
So what’s the deal? How do you get a set of posts with a specific taxonomy term in them?
Any help would be appreciated…I’m pulling my hair out.
- The topic ‘Get Posts with Custom Taxonomy’ is closed to new replies.