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.

OK, it's more a philosophic question that a programming question, but at the end it will have a huge impact on code...

I have 5 main product, a,b,c,d,e

those 5 products have options those products can belong to multiple category

So the end, i should show the product a, with below, option of product a witch is a1, a2, a3, a4 and below, the other products that belong to the same category as a, so it can be, x, y, z.

So it look like

  • a
    • a1
    • a2
    • a3
    • a4
  • x
  • y
  • z

How should i manage categories, should i create a category witch name is option for a or there is a better way. Organising is not my stongest point, but good organization can lead to easy coding..

thanks in advance


idea, if i can control the ID of the post created, i will create product a as id=100 and all option as product option a1 : id-101. option a2 : id=201 and so on ..

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I'm pretty sure i missunderstood you...

Approach: Categories & Terms (built in taxonomies)

You have got categories (hierarchical built in taxonomy) & terms (non-hierarchical built in taxonomy). You can also assign terms to categories. So i'd say, you can take the following approach using the built in taxonomies:

  • shoes (parent category)
    • boots (child category)
    • sneakers (child category)
    • other shoes (default child category)

and then use terms inside additional categories like:

  • color (parent cateogry)
    • cyan (term)
    • magenta (term)
    • yellow (term)
    • black (term)
  • laces (parent category)
    • long (term)
    • medium (term) and so on ...

This would give you the ability to list all shoes on a category page. Then you can further list all sneakers on one page. You can also list all shoes that got long laces and red color.

Templates

Take a look at (for eg.) here for more information about the query for different archive (category/term) pages and how to query/retrieve multiple taxonomies at one page.

share|improve this answer

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.