1

I have products for which I want permalinks as following

https://example.com/product/manufacturer/brand/model

i.e

https://example.com/product/manufacturer-1/brand-1/model-11
https://example.com/product/manufacturer-1/brand-2/model-12
https://example.com/product/manufacturer-2/brand-3/model-23
https://example.com/product/manufacturer-2/brand-4/model-24

So to do this, I will create new custom post type "Product"

Also I want the:

archives of manufacturer with permalinks as

https://example.com/product/manufacturer-1/
https://example.com/product/manufacturer-2/

and

archives of brands with permalinks as

https://example.com/product/manufacturer-1/brand-1/
https://example.com/product/manufacturer-1/brand-2/
https://example.com/product/manufacturer-2/brand-3/
https://example.com/product/manufacturer-2/brand-4/

And I want to filter products by brand and manufacturer

So I was wondering what should I do regarding manufacturer and brand Should I make

  1. manufacturer and brand as custom post types ?

  2. manufacturer and brand as separate custom taxonomies ?

  3. manufacturer and brand as one custom taxonomy i.e manufactuere as top level taxonomy term and then brand as child term of manufactuere

SO please help and guide me how to proceed

thanks a lot for you inputs

1
  • 1
    The third approach seems the most sensible.
    – clayRay
    Oct 20, 2021 at 22:41

1 Answer 1

1

Permalink structure is a hierarchy, each level should be descendent of one another, be more specific i.e. shop.com/products/books/fiction/harry-potter where every book is a product, fiction is a genre of books and Harry Potter belongs to fiction books.

So in your example product/manufacturer/brand/model every brand should belong to a single manufacturer and every model to a single brand from that manufacturer. If that is the case, just use a single taxonomy - product category and create a hierarchy.

If one brand can relate to more than one manufacturer you need separate taxonomies and your permalink structure has to be different.

1
  • thanks for help.. but fo you happend to have the code for this .. because the one I am trying is not working perfectly .. I will update it above Jan 16 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.