You can use is_category
to check if the category is “members” and then load the appropriate template.
In get_template_part()
use the template name for the second parameter instead of get_post_format()
.
In this example your template should be named “content-members.php.”
while ( have_posts() ) : the_post();
if ( is_category( 'members' ) ) {
get_template_part( 'content', 'members' );
} else {
get_template_part( 'content', get_post_format() );
}
endwhile;
Related Posts:
- Adding categories to custom post type in permalink
- How to change permalink structure for custom post type and it’s taxonomies?
- Filtering a custom post type by custom taxonomy in archive template
- How to build a complex page structure
- Add category to custom post URL
- Load custom posts with same tag as page
- Hide/Show only specific categories in wp-admin new-post.php
- 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
- Template tags to display custom post type posts in category template?
- 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
- WP Query group/order by category name
- Taxonomy list. Order by a specific custom post type count
- How to show custom taxonomy in the permalink?
- Custom/separate categories for custom post type
- Loop through categories and create tab for each
- Categories not working as expected with custom post type
- Query custom post types
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Custom Post Types and Categories?
- Set a default category – if the user didn’t select one- before creating a post
- Get categories and descriptions from custom post type
- How to create new category for custom post type?
- Should I use custom taxonomy or custom post type
- How to show CPTs in term archive
- Group posts by custom post type
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Get parent categories of custom post type
- How to query_post custom posts within default taxonomy?
- Custom Post Type With Categories
- Display posts from Custom Post Type in category page on front-end
- Showing posts from different categories and from custom post type
- 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
- Category with post type pagination returns 404
- Custom Post Slug same as Parents Category Slug
- Pre-selecting the category for a custom post type
- browse by category and tags?
- List of Posts and Categories
- category page for custom post type
- Getting used tags per post type
- Why does accessing url by category cause issues with post types?
- Navigate posts with different post type that are in the same categories
- Why does my taxonomy have a category style div id?
- Unable to edit categories in custom post type
- Custom Post Type Category URL
- Custom Post Type Categories URL not displaying posts
- WP Query results showing posts outside of category ID
- Restrict category access to specific users/groups. Author always has access
- How to get Custom Post Type with Categories wise in WordPress using wp_query
- Better approach for a WordPress Inventory
- Showing all posts and custom post types by using one category
- get_terms() parent, child and grandchild
- Custom Post Type Custom Archive Page Not Working
- How to properly use Categories with Custom Post Types
- 4 posts per page from single category
- Menu’s breaking, now showing all page links on site
- Retrieve Custom Taxonomies with Description and Slug
- Custom post type category permalinks and archive pages
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- Display custom post types by category
- Searching in multiple category + URL hierarchy in real estate WordPress site
- Category permalinks don’t work even after flushing
- How to set “section categories”?
- Cannot use object of type WP_Error as array display category
- 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?
- Cannot get to work tax_query array for terms
- Page + Custom Post Type with same category
- Loop through a specific parent category
- Query the title of the page to show posts with matching category in the loop
- Custom post types not displaying per category
- How to Show all Values in category.php page using post_type
- How To Display Category list from Portfolio post type plugin?
- Can’t seem to filter wp_query by current category ID
- Dropdown switching subcategories portfolio
- Custom post type URL – filter by taxonomy
- Custom Post type archives / categories give 404
- How to query all custom posts of a certain type and checking what category they have
- Post Editor: display categories from current post type taxonomy only?
- Custom Post Type – Admin Columns
- Having some trouble properly displaying Custom Post Types in templates
- Customize category URL
- Category / Custom Post Type permalink issue
- Categories in custom post types
- Limit to add one post per category only
- Sorting custom post types by category?
- categories of custom post type shows in CMS but not in the frontend webpage
- Categories and page filtering with pre_get_posts
- How can I sort posts ascending by post title for a specific post type, but on a category archive template?
- Get all custom_post_type posts + blog posts from one category in a single query
- Select Category as Page Parent
- Add Category names to post lists of custom post type