I'm trying to get the parent ID of a category. I've searched around but the only things I can find on this get the top level parent ID not the direct parent of the current page ID.
I have 3 layers of category:
cat 3 is a child of cat 2, cat 2 is a child of cat 1.
If I'm currently on the cat 3 page how can I get the ID of the category directly above it? (cat 2)
Appreciate any help!