You have to register built-in “category” taxonomy for the “Activity” post type:
<?php
function add_categories_to_activities()
{
register_taxonomy_for_object_type( 'category', 'activity' );
}
add_action( 'init', 'add_categories_to_activities' );
See register_taxonomy_for_object_type()
in the Code Reference.
Related Posts:
- Custom post type loops with different page templates
- Template code to split a post and print a custom field?
- Function to allow single post template based on custom taxonomy?
- Conflict in function to allow single post template based on category
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Custom Post Type with Templates using Meta Boxes?
- Can I list a custom post type within another custom post type in the admin area?
- Change custom post type slug from plugin options
- Query with no terms uses index.php template instead of archive.php
- Create template for taxonomy results limited by Custom Post Type
- Can’t edit custom post type
- Template for custom post with custom taxonomy
- WordPress Custom Post Type Children Template
- Getting template_include to work when allow_url_include is off?
- Custom post type content using custom fields without template
- Set URL link to featured image of custom post type
- Change CPT archive title
- AJAX load more for different custom post type loops
- PHP variable not regenerating when publishing multiple posts at the same time
- 2 Templates 1 custom post type according url
- On update or create post redirect to current post position in list
- I need to add endpoint for wordpress categories
- How to target a specific custom post type post and its all children and grandchildren?
- Featured image overlay when changing post status
- get_post_meta not working on publishing
- Custom taxonomy and custom post type – wrong permalinks and template
- Redirect 404 page with ID in slug to associated page with same ID in slug
- WordPress wrapped added a span tag to every single p tag
- ACF field key/value to show on taxonomy list
- Re-registering a custom post type not working (not showing up)
- Display featured image from one CPT within another CPT query
- Query taxonomy of taxonomy of custom post type
- Best way to style first post differently?
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- How to make custom posts types display when published for the future
- How to rewrite url for any specific taxonomy?
- create a new page from a custom post type similar to an authors page
- CPT archive admin menu label
- Anon function and add_meta_box
- Content vs Template on custom post
- How to use custom template files in deeper directory?
- Hide a widget inside a div on specific type of post
- WordPress Doesn’t Generate Taxonomy Archive
- Shortcode not working with post counter
- A case for Hierarchical Custom Posts
- Changing default ‘posts’ parameters with register_post_type_args
- Custom taxonomy returns 404
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Cannot save CPT meta box
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- Allow users to create posts without logging in?
- Template for all categories of a custom post type?
- How to change permalink to include custom post type
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Migrating a taxonomy’s tags to the native category
- Add term to custom post type on draft
- Flush Rewrite Rules when new site is created on network
- How to assign classes to all elements?
- next_/previous_post_link() `in_same_category` appears to fail when true
- Want to be able to sign up subscribers as authors
- WordPress custom taxonomy template not working
- How can I get this request to use the Custom Post Type page template instead?
- Load scripts based on post type
- Different Category system needed for the Custom Post Type
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- Archive for a Taxonomy of a Custom Post type
- Global custom meta box
- Template not working for the custom Post type
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- categories should be available across all custom post types
- Custom post type pages return 404 page?
- Warning: Invalid argument supplied for foreach() in post.php [closed]
- Featured Image field not appearing in Custom post type
- WordPress 3.9 not using custom template
- Template files for Custom Post Type and Taxonomy
- Set templates for custom post types
- How to Create Template File for Parent Page of Custom Post Type
- Post-thumbnail only for specific post-types?
- custom post type metaboxes not saving
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Custom post_type search pages
- Enable taxonomies by post type in an array of CPTs
- how to remove pages loading with the archive templates
- PHP question: how to combine syntax?
- Main query not querying any posts in custom taxonomy template
- Custom Empty Results page for my Custom Post Type
- Loop increase number
- custom post for slider
- Custom posts template page
- ACF in wordpress
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- How can I use archive-{post_type}.php theme template?
- Change Slug of a Custom Post Type
- Excerpt function for any content
- Assign category a default post type
- Navigate posts with different post type that are in the same categories