It appears that although register_post_type()
will add the new post_type
immediately, it seems as though you need to bind up the logic into a function, and add it to the init
action for the categories taxonomy to be associated with the post_type
. A working example follows:
function add_articles_post_type() {
register_post_type("article", array(
'label' => 'Article',
'public' => true,
'hierarchical' => true,
'supports' => array('title','editor','author','thumbnail','revisions')
));
register_taxonomy_for_object_type('category', 'article');
}
add_action('init', 'add_articles_post_type');
Related Posts:
- How to change permalink structure for custom post type and it’s taxonomies?
- Get the first post term
- Creating “static” taxonomies to choose from, inside custom post type?
- How can I list all the categories under a Custom Post Type (taxonomy)?
- How to list all categories and tags in a page?
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- How can you make permalink work for custom post type and taxonomy?
- How to get a list of term names of the custom post type im currently on in single.php
- List all custom post type posts from a given category?
- Custom post type taxonomy template
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- Category page only displaying the posts from a custom type
- Show Post Count of a Category
- How to create new category for custom post type?
- Get Post Primary Category
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- How to get the post type from a category id?
- How to show CPTs in term archive
- Display all posts in main category and 1 subcategory
- Show category ID on custom post type
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Limit amount of posts made within a custom taxonomy
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Categories and tags for custom post types
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- Invalid Taxonomy
- Need help deciding on a taxonomy
- Get Posts by Category, Tag , and CPT Taxonomy
- Get assigned post categories
- Default Category Page not showing custom post type which has taxonomy category
- Categories won’t appear on custom post type
- Custom Post Type with modified permalink structure results in 404
- Custom post type, taxonomy and admin bar
- Displaying taxonomies as category links within sidebar and creating pages for these
- Custom post type archive page filters
- How to show related posts of category on post within custom posttype
- get taxonomies from terms
- Create custom post type categories
- Set a Default CPT taxonomy by taxonomy id
- how to create custom taxonomy drop downs for parents and child
- How to manage a dynamic multi-level page hierearchy system?
- Categories manage
- I can not call the categories of custom post type
- Reuse the “category” slug for a custom post type
- How to create groups like that in buddypress?
- Update Cateogory Taxonomy Count for Attachment Post Type
- Best way to structure article and issue relationship for CPT
- Custom Post Type used for FAQs Accordion
- category_name not working in WP_Query
- How can I set up the URL for a category archive for a custom post type?
- Custom Post Type order Title ASC
- show only one category posts in admin
- Is it possible for post and custom post type to share a category base slug?
- Displaying category archive of custom post types
- Retrieve single term slug
- Categories assigned to custom post type not found
- Custom Post type taxonomy single templates
- Restrict categories to a custom post type
- Use the_taxonomies() to create a simple list
- Getting all custom posts with a certain category
- How to get category image custom post type taxonomy in wordpress?
- Permalinks for Taxonomy and Custom Post Type
- Query Custom Post Types & category_name?
- Custom Post type is being ignored in query
- Insert HTML inside link in a walker
- Hide specific parent categories from post edit
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Getting posts under the custom post type ui category
- Separate custom categories from default category
- Several post types on WP Query by tag and taxonomy
- How do I display the grand child items of a taxonomy term?
- Is it better to use WordPress Custom Post Types or Taxonomies?
- School & class blogs: Categorize with categories or custom posts?
- How to get custom posts sub category link
- CPT category hierarchy
- Unable to link categories to custom post type using standard function
- Custom post type – list posts based on meta_key and display them divided by CPT taxonomy category
- category list with cutom post count
- Display 1 Post per taxonomy with polylang
- CPT : Next or Previous term link when has not adjacent post
- Display Custom Post Type Based on Taxonomy With WP_Query()
- How to add CSS class field in Custom Taxonomy?
- Pagination for a cpt filtered with a category
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Change custom post type permalink according to category
- Changing an item in drop down after 5 latest posts per taxonomy
- Query for a custom post taxonomy
- Related posts by taxonomy [duplicate]
- Connecting multiple post types? Or linking “News” posts with “Game” posts how?
- Sort by Custom Post Type (Multiple Loop)
- How to display elements of different post types?
- Display a custom post type list by taxonomy term
- get_the_term_list() wanting to loop through the returned values
- Displaying child taxonomies
- create category upon saving post and save post in that category
- Can a taxonomy of a custom post type be called ‘category’?