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.

So: I am making a WP site for a company that makes aftermarket performance parts for cars. I have used the post mechanic in WP to add in these parts. Each part has its own page, and I have registered two custom taxonomies: one describes the kind of part that it is, the other describes the kind of vehicle that the part fits. Each part is compatible with several vehicles so each post has a few different terms in the 'compatiblecars' taxonomy but it will only have one term in the 'partstype' taxonomy.

To build the navigation for the site, I have a list of the compatible cars and for the menu (which I am using YUI module for, that's not the problem!) I need to call a list of the 'partstype' terms that the posts in each different 'compatiblecars' term have. So, for example, there are twenty parts that are compatible with a Beetle for example, when you click on Beetle I need a list of the five or six different parts types (like, Brake Upgrades for example) that are compatible with the Beetle, and when you click on the term, you go to a page that has all the Brakes Upgrades for Beetles on it.

My understanding is that the best way to do this is to do a query_posts that calls all the posts with the 'Beetle' term in the 'compatiblecars' taxonomy, use the loop to pull the terms from the 'partstype' taxonomy for each individual part, dump these into an array and then echo that, and have each term link to that part type: my php skills are woeful, I am literally just beginning so I can't even begin to approach this without at least a starting point.

If this isn't possible, let me know, at least I can stop banging my head on this brick wall! Thanks!

share|improve this question
add comment

1 Answer

Read through this and this.

share|improve this answer
    
Thanks for the links Kaiser, but if you re-read my question, it isn't calling posts that I am having a problem with: I need to call a list of terms that appear in any post on the site that is also 'tagged' with another specific term from a different taxonomy. Just querying the database to summon up posts with a term is not the problem. –  user5474 May 18 '11 at 16:46
    
So you're searching for "related custom post types" plugin? –  kaiser May 18 '11 at 17:50
    
No, I don't think I am explaining this right. I have all these parts as posts, that's fine. Each part has got one specific 'type', by which I mean, is it a wheel or a brake upgrade or whatever. This is allocated to the post using a custom taxonomy called 'partstype'. Each part is compatible with a range of vehicles, so lets say part 100 has a term 'wheel' allocated to it in the 'partstype' taxonomy. That wheel will fit on the following vehicles 'beetle', 'golf', 'polo'. These are added as terms in the taxonomy 'compatiblecars'. –  user5474 May 18 '11 at 21:53
    
I need to call a list of all the terms that appear in all the posts that are 'tagged' with each of the terms in 'compatiblecars'. So a list of all the terms that appear in all the parts that are compatible with Beetles, for example. So if there are no brake upgrades that you can use with a beetle, the list will not contain brake upgrades. If I used custom post types for the car types, for example, then each part could only be compatible with one kind of car, but they need to be compatible with more than one. –  user5474 May 18 '11 at 21:56
    
How many Qs are you asking? Sorry, but you're confusing me. I guess best would be to get rid of 90% of the text and show us some table about what you want to get. So far i understood that you have the following: taxonomy: compatiblecar (terms are car names - not brand), taxonomy: partstype (terms are part groups like eg. wheel, break, suspension). Right? –  kaiser May 19 '11 at 11:57
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.