I have multiple post page using custom post type and all post type have more categories and sub categories
So i need to display particular categories specific and categories specific to post type
Example
Post A
category1
subcategory11
subcategory12
category2
subcategory21
subcategory22
Post B
category3
subcategory31
........
subcategory32
category4
subcategory41
subcategory42
and so on so if i go to post A page
category1
category2
and so on so if i go to Category 1 page i need to display only sub category of current category
subcategory11
subcategory12
Is there any plugin to achieve this or any custom code can be written