Knowledge Base

How can I activate the category tree for a post type?

You have Real Category Management installed, but you don’t see the category tree next to the table with all your posts, pages, etc.? Sometimes you need to enable it for your post type, and we will explain how to do it.

Supported post types

Real Category Management can show the category tree for the following views:

  • Posts > All Posts
  • Pages > All Pages (only in PRO version)
  • Products > All Products (if WooCommerce is installed; only in PRO version)
  • Custom Post Type > All (e.g. Movies, Team, Templates; only in PRO version)

After you have installed and activated the plugin, you should see the tree view for posts, pages and WooCommerce products immediately.

Enable tree view for custom post types

You can enable the tree view for any custom post type in your WordPress (PRO version only). The only requirement is that your custom post type has the hierarchical property enabled, as we use the hierarchical structure of the post type taxonomies to display the tree view.

Custom post type with Custom Post Type UI (CPT UI) created

If you have created the custom post type with the plugin Custom Post Type UI, go to CPT UI > Add/Edit Post Types > Edit Post Type > Select [name of your post type] > Settings > Hierarchical in your WordPress backend and set it’s value to True.

Enable hierarchical property in Custom Post Type UI for a custom post type

Custom post type as code created

If you have created the post type in your code, make sure that the hierarchical property has the value true.

$args = array(
    [...]
    'hierarchical' => true,
);

register_post_type( 'Recipe', $args );

WordPress Plugins by devowl.io

Find helpful articles

Topics