I wonder if someone could help me.
I just upgrade my wordpress and start to use taxonomy.
what I want to do is to query posts from different categories.
I used to do it like this
query_posts('cat=5');
but with taxonomy added to my categories, doesnt work anymore
for example if I go to a category page the link goes like this
www.website.com/ad-category/cars
I guess my taxonomy category name is “ad-category” and the category name is cars
but how could I query posts from categories ids, example 5,6,7,8 etc..
Thak you for your time!!
As Bloch commented, 3.1 provides a way to easily accomplish this. Here’s a terrific article describing exactly how to execute advanced taxonomy queries. Here’s the plugin to run the 3.1 beta.
Here is some slightly modified code from an example in the advanced taxonomy queries article:
This should give you a decent idea (haven’t tested it though)… good luck!
I’m not sure if this is exactly what you’re looking for, but it was working for me to grab different post from different taxonomies and doing stuff with them:
Using that I was able use that however many times I needed to run though my custom post types. I ended up going a slightly different route, by adding a foreach loop around the outside and running thru each of my taxonomies to set a variable dynamically. You can see my post at: Dynamic variable for custom taxonomy in loop?