WordPress only includes the post
post type for Category archives by default, but you can add additional post types by altering the query:
function wpse241719_add_custom_types_to_category_archives( $query ) {
if ( ! is_admin() && is_category() && $query->is_main_query() ) {
$query->set( 'post_type', array(
'post',
'work',
// 'another_post_type',
) );
}
}
add_filter( 'pre_get_posts', 'wpse241719_add_custom_types_to_category_archives' );
Related Posts:
- Glossary with Custom Post Type
- List all custom post type posts from a given category?
- get_terms won’t display product_cat or any other custom taxonomies when specified
- How to get category image custom post type taxonomy in wordpress?
- Category page only displaying the posts from a custom type
- Custom Post Type Archive Page Filtering
- Allow user to set custom order to a list of custom taxonomies?
- How to get custom posts sub category link
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Get parent category id from child category page for custom taxonomy
- How to Display Posts From Category Within a Custom Taxonomy?
- The Difference Between Categories and Tags and Taxonomies and Terms
- Get category if used in a custom post type
- Get terms for a specfic post from multiple taxonomies in custom post type
- Retrieve Custom Taxonomies with Description and Slug
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- How to display custom taxonomy term specific post?
- get taxonomies from terms
- Cannot get to work tax_query array for terms
- Get a list of categories ids
- Using get_terms() as shortcode attribute
- How to determ a custom post type url?
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Add custom post type settings to wordress default posts
- How do I display the taxonomy term alongside the post type post title?
- Hide parent categories when clicked, and show it’s childs
- Custom post taxonomies as tax_query terms?
- Limit amount of posts made within a custom taxonomy
- Problem with displaying posts in the CPT category
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Filter CPT posts by one or more categories
- Getting categories of posts under a custom taxonomy
- Post count by month of taxonmy term
- Custom Post Types with a common category for a blog listing
- Can’t remove front from permalinks for custom taxonomy category page
- How to get categories linked in posts for a specific post type
- Custom post type, organized by categories
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- Remove CPT name from permalink but add %category% instead
- Set a checkmark in a category based on a URL-parameter
- WP Query with categories only shows one post and ignores the category
- How do I display the taxonomy for a custom post type in an array
- Adding custom post type to count in category
- How to edit this code to get the categories in achieve page?
- Category with post type pagination returns 404
- Custom Post Type and Category Base Rewrite Issue
- Get the category from custom post type
- Post injections into Site Origins Page builder [closed]
- Custom Post Type + Categories
- Display Custom Taxonomy Alphabetically
- How to create a gallery page with categories?
- Custom Post Slug same as Parents Category Slug
- WordPress posts page for customer filtering and sorting along with category filter
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post, set object Taxonomy terms in plugin
- I am having Trouble to get list of Categories of Custom post Type
- Hierarchy and access control for Custom Post Types (CPT)
- Multiple (two) category postings on the same page.
- How to include term custom meta into the custom taxonomy term permalink structure
- Loop filtering Custom Post Types and/or Categories
- Setup template_redirect using has_term when NO term assigned
- School & class blogs: Categorize with categories or custom posts?
- Custom post type and category link together
- Get terms that contain posts that in turn belong to other terms?
- Why is my category template ignoring post type?
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- Custom while loop for hierarchical display of a taxonomy
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- Not sure if I should create multiple custom post type [closed]
- Cross reference custom post types
- Make a custom_post translatable
- Pre-selecting the category for a custom post type
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- Display taxonomy terms, child terms and posts in a template
- Foreach inside shortcode not working as planned
- Use custom walker to add taxonomy terms to main nav menu
- browse by category and tags?
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Categories filtering in new post
- Custom post types and category archive
- Add term to custom post type on draft
- PHP Code to Display Term URL & Name of a Post Under a Custom Post Type
- List of Posts and Categories
- Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?
- How can I show 1 featured post in a styled element, and the next few below differently styled
- Listing all term items alphabetically / sorting loop
- How do you create a custom template to display a category with an image and related posts below?
- How can I list Custom Post Types created with the Types plugin under categories?
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom templates for a specific category
- Targeting custom post type
- How to get WordPress term attached to the Post?
- Query posts with double taxonomy
- CPT category hierarchy
- Output terms for custom post types
- Categorise Custom Post Types
- WP the_posts() on single-cars.php get category link