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
- Get The Post Type A Taxonomy Is Attached To
- How to limit the number of terms (terms acts like categories)
- How can I list all the categories under a Custom Post Type (taxonomy)?
- category__in not working on custom post type
- Use standard WordPress categories with a CPT
- How can I add single catogory for custom post type?
- Get the post_type of current taxonomy or category page
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Output the slug and name of a CPT single post taxonomy term
- automatically save custom post type title as a category
- get_categories() for only CPT
- custom taxonomy archive by year
- Possible for Category Base and Custom post Type to share the same slug/permalink?
- Weird problem happening with custom taxonmy when creating/updating posts
- How to detect filter in URL in Category page?
- CPT Archive with core Category
- Replace li Items with divs with classes
- showing custom post types of a certain category only
- Get posts from a custom post type by child categories of a parent category
- Filtering WP_Query Dynamically on the Front-End
- get_posts() with custom post type does not work outside page.php
- Show a Category X’s custom post type on Category X archive page?
- Multiple level category drop-down from the WordPress dashboard
- Getting categories of posts under a custom taxonomy
- How to get categories linked in posts for a specific post type
- How do I display the taxonomy for a custom post type in an array
- How to edit this code to get the categories in achieve page?
- Get the category from custom post type
- How to create a gallery page with categories?
- How to include term custom meta into the custom taxonomy term permalink structure
- Setup template_redirect using has_term when NO term assigned
- Cross reference custom post types
- Make a custom_post translatable
- Display taxonomy terms, child terms and posts in a template
- Use custom walker to add taxonomy terms to main nav menu
- Add term to custom post type on draft
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom templates for a specific category
- How to retrieve category of a post in have_post loop?
- How to add current custom taxonomy slug to body class
- Meta data (Tags and Categories) for Custom Posts not showing.
- Custom post types with categories in template
- Get assigned post categories
- Default Category Page not showing custom post type which has taxonomy category
- Post Query not working
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Commas not displaying in implode
- Category Name with Custom Post Type
- Am I mixing up the concept of posts pages and categories?
- CPT archive page – show one post from each taxonomy term
- how to organize my categories or should I do custom post types for some?
- Order Categories by Hierarchy?
- Multiple categories assigned to a single product breaking the breadcrumb
- How to divide Subcategories into pages of parent category wordpress
- Custom front-end form for adding post – Category problem
- Custom Post Type Category Displaying ALL Sub Categories as well
- Control over custom post types on a specific page
- Feature image Gallery made from Custom Post type + Categories
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- Get meta values from parent post and save in child post
- wp_set_post_terms not updating with WP Cron Event
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Use Category for Custom Post Type – But Need Another Separate Archive Page too
- Only show current category post
- how to use two permalinks for one custom post type based on categories
- Custom Catagory not found
- Page to show custom posts and one category
- How can I list custom post by custom category?
- how to show perticular category posts in custome page
- Use only selected regular categories for a Custom post form
- Bulk remove category from custom post type?
- Problem with menu categories doubling up when updating database?
- Remove slug from Custom Category Permalink + dual-category permalinks
- Display associated taxonomy child name on single CPT page
- How to query posts by category with the_title();
- Issue On Listing Woocommerce Parent Tag List
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Categorizing Custom Posts in Bulk Based on Title