My wordpress site has categories with a simple hierarchy –
- Role Shift
- Urod the Last Show
I’m using the if statement below to catch if the post is in category blog or any of the child categories – and it works – but it feels stupid not to be able to just check the parent of the current category (plus I might want to add categories later).
if ( is_category('blog') || in_category(array('role-shift', 'urod-the-last-show', 'news')) )
I’ve searched and tried every suggestion – including
cat_is_ancestor_of – but nothing is working.
Read more here: Check if category of post is x or is child of x