I have to find a way to get the top level category of a post.
I have a few categories that function as top level category. They have no posts themselves. Beneath them are a few categories that contain posts. When I click one of them, for instance index.php?p=23 I want to know to what top level category this post belongs to, like this:
-- Golden Retriever
In this case Golder Retriever belongs to top category 'Animals'.
Is there a way or a plugin that can do this? I need it to show a different image at the top of the page.