1. Home
  2. Docs
  3. Advanced Category Listing...
  4. Detail Document
  5. Add Custom Taxonomy

Add Custom Taxonomy

You can add Custom Post Type Category Images by following this:

1. Add Categories to a Custom Post Type with a Plugin

If you’re a beginner, we recommend using the Custom Post Type UI plugin to create custom post types.

Like if You have created Custom Post “Movie”. In this post you have to create Custom Taxonomy “movie_category”, For Custom Taxonomy Category You need to add this:


In Custom Post Type with a Plugin you need to do ‘hierarchical’ = true. It will create Category. Image field will be appear in your Custom Post Taxonomy Field.

2. Manually Adding Categories to a Custom Post Type

If you created your custom post type by adding the code in your theme’s functions.php file or a site-specific plugin, then you will have to modify the code to add category as supported taxonomy.

add_action( 'init', 'register_custom_taxonomies', 0 );
function register_custom_taxonomies()
{
register_taxonomy( 'movie', 'post', array(
"hierarchical" => true,
"label" => "Movie",
"singular_label" => "Movie",
'query_var' => true,
'rewrite' => array( 'slug' => 'movie', 'with_front' => false ),
'public' => true,
'show_ui' => true,
'show_tagcloud' => true,
'_builtin' => false,
'show_in_nav_menus' => false
));
}


You need to add ‘hierarchical’ => true. It will create Category and you can see image field in your Custom Post Field.

How can we help?