Get parent categories of custom post type
If you’re in the single custom post template, you can get the terms that the post belongs to by use of $terms = get_the_terms( get_the_ID(), ‘btp_work_category’ ); Then you need to determine parent term and display it with its children. The code below assumes that the post belongs to one top category (term) and the … Read more