wp_get_object_terms
will give you the term assigned to the post, you could then use get_ancestors
to get an array of the parent’s IDs, then get_term_by
ID to get the names and slugs.
wp_get_object_terms
will give you the term assigned to the post, you could then use get_ancestors
to get an array of the parent’s IDs, then get_term_by
ID to get the names and slugs.