• Ok so i’ve got categories like setup like this.

    Products
       Category A
           Sub Category 1
           Sub Category 2
       Category B
       Category C

    What i need is to have the Products category page showing the main Categories (A,B,C).

    The main Category pages (A,B,C) showing their sub Categories (1,2).

    Then the Sub Categories (1,2) showing my custom post type i.e the actual products.

    I want to avoid using a category-slug.php template because when someone adds a new category i want it to show automatically on the correct page, based on what the parent is.

    I thought about using a category.php template but i don’t know if this is possible from one template or what code i would need.

    The first category pages (Products) will only display the main Categories (A,B,C). It won’t be showing any posts just a list of category links in the main section. So i can style them so they are like big buttons on the page. The same will be for Category A,B,C. Show the sub categories.

    The last category page (sub category 1,2) will show my custom post type (the actual products) in some sort of list. This page won’t show any other categories just the Products in the main section.

    Any help on how i can achieve this would be appreciated.

    Thanks

  • The topic ‘Category template to show different categories based on parent’ is closed to new replies.