I have a parent category with many sub-categories and I am trying to display the page differently when it is in that specific parent category.
But instead of writing the code like is_category(‘parent’, ‘sub-1’, ‘sub-2’)…etc, is there an easy way to say if it is in the parent category it is true?
I’m not sure I fully understood your question, but wrapping a function inside a new function will make it shorter. For example, do the following in your functions.php file:
And then simply use it like: