I have this structure for my categories:
Issue 4
- News
- Supporting our troops
- Breaking news
<?php
$category = get_the_category();
$parent = $category[0]->term_id;
?>
This code gets the top level category ID from "Breaking News" which is Issue 4, missing out News its direct parent category.
How could I get the category ID for "News", its direct parent category and not the top level category?