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?
- Category display using conditions
- Separate archive template to show posts and CPT by same category/taxonomy
- Add taxonomy or category slug to custom post types URL
- How to determ a custom post type url?
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- Multiple level category drop-down from the WordPress dashboard
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- How to Filter custom post type by taxonomy?
- Add custom post type settings to wordress default posts
- Is it possible to have dedicated page for parent/child taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Hide parent categories when clicked, and show it’s childs
- Custom post taxonomies as tax_query terms?
- Get related posts of child term of custom post type
- 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
- 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
- list taxonomies from a custom post type
- Display a grid of taxonomy terms at root taxonomy page
- Custom post type, organized by categories
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- Show child custom post types list inside single parent custom post type
- limit value taxonomy based on previous taxonomy value wordpress
- Remove CPT name from permalink but add %category% instead
- Set a checkmark in a category based on a URL-parameter
- Several post types on WP Query by tag and taxonomy
- Using meta_query and tax_query at the same time
- 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
- Set a CPT slug as a base name for all the taxonomies
- Adding custom post type to count in category
- How to conditionally redirect to the post from a taxonomy page?
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- How do I display the grand child items of a taxonomy term?
- How to edit this code to get the categories in achieve page?
- Category with post type pagination returns 404
- Taxonomies relations
- Custom Post Type and Category Base Rewrite Issue
- Is it better to use WordPress Custom Post Types or Taxonomies?