Have a look at this article in the the WordPress Theme Developer Handbook.
You should create a template in your theme named category-unicorns.php
where unicorns
is the slug for the parent category you want this template to be used for.
You can also create a template file category-5.php
where 5
is the id of the parent category.
Related Posts:
- Template tags to display custom post type posts in category template?
- Creating Sections for Post Types
- Custom post types with categories in template
- How to get the current category with custom posts
- Archive Template being used instead of Category Template for Custom Post Type
- Having some trouble properly displaying Custom Post Types in templates
- Choose custom post type template by category
- How to change permalink structure for custom post type and it’s taxonomies?
- Filtering a custom post type by custom taxonomy in archive template
- tag.php doesn’t work with tags on a custom post type post?
- Assign single template to multiple custom post types?
- Add Content to Page without shortcodes
- How to build a complex page structure
- Load custom posts with same tag as page
- Hide/Show only specific categories in wp-admin new-post.php
- Custom taxonomy query for a custom post type
- Get categories for a specific post – Custom post type
- Include custom post types in categories widget
- How to get dynamically custom post type that are under a certain category
- How do I create new content pages for my Custom Post Type?
- Listing and accessing categories for a custom post type
- How to show related posts by category or custom post type?
- Custom Post Type, Two categories, Two columns with Pagination
- New WP_query in template not working with CPT+category on some pages
- custom taxonomy – Template not working
- Taxonomy list. Order by a specific custom post type count
- Create separate template for shared custom taxonomy with shared terms
- Custom/separate categories for custom post type
- wordpress 3.4 template files in subdirectories
- Categories not working as expected with custom post type
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?
- Help with CPT template pagination
- Merge multiple custom post types in a single archive template
- Get categories and descriptions from custom post type
- Trying to edit the single page from a Custom Post
- How to create new category for custom post type?
- How to show CPTs in term archive
- Custom Post Type template stored in plugin folder not showing in post attributes dropdown
- Group posts by custom post type
- How to clone the “Projects” Custom Post type in Divi theme
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Categories of custom taxonomy don’t show any posts
- Can’t remove front from permalinks for custom taxonomy category page
- Adding custom post type to count in category
- How to use custom template files in deeper directory?
- Pre-selecting the category for a custom post type
- List of Posts and Categories
- How can I get this request to use the Custom Post Type page template instead?
- Create new custom post and post category of same name
- multiple custom post type on category page
- Custom posts template page
- Add Previous/Next Buttons to CPT Single Pages Only
- Custom Post Type Categories URL not displaying posts
- Templates for hierarchical custom post type
- Apply template by path/slug related to custom post type?
- WP Query results showing posts outside of category ID
- List child categories from parent category on custom taxonomy page
- How to properly use Categories with Custom Post Types
- Create a custom taxonomy template that loops through child categories in term order?
- My template won’t apply, theme still fallback to index.php
- Custom post type category permalinks and archive pages
- One Custom Post Type two different Templates
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- On click some element i want to use some template
- Display custom post types by category
- Searching in multiple category + URL hierarchy in real estate WordPress site
- Post template with breadcrumb needs to show page navigated from
- How to display custom taxonomy term specific post?
- Category permalinks don’t work even after flushing
- Accessing download link from the loop with WP Download Manager Pro
- How to sort post category using its Description
- Custom WordPress theme not displaying posts from category
- Wanting to list all Post types under a common category
- How to show posts of the same category on a page?
- Modify the category post counting function
- WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered
- Reuse the “category” slug for a custom post type
- Custom post types not displaying per category
- How to make a custom search template for custom taxonomy?
- Custom post type with two templates
- How To Display Category list from Portfolio post type plugin?
- Custom Post Type tag taxonomy “Page Not Found”
- DIVs not showing correctly on CPT?
- Dropdown switching subcategories portfolio
- Custom Post type archives / categories give 404
- Custom Post Type – Admin Columns
- Problem to show custom post type in archive page category wise
- Load different template for CPT (in loop) in my plugin?
- Category / Custom Post Type permalink issue
- Categories in custom post types
- Sorting custom post types by category?
- Template with Custom Post Type (Custom Tables) does not work
- Categories and page filtering with pre_get_posts
- Get all custom_post_type posts + blog posts from one category in a single query
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- Select Category as Page Parent
- CPT Template Option to Top
- How to create custom page templates with default page layout framework?
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?