Hi! I’m trying to get my widget to show up only in the following places:
– on a specific category page
– on any post within that category
– on any post within a child of that category
I’ve got 2/3, but that last one has eluded me, despite much scanning of the Codex and Googling.
What I have now:
is_category(5) || (is_single() && in_category(5))
I’ve tried the post_is_in_descendant_category function described here: http://codex.wordpress.org/Function_Reference/in_category
but that broke my blog (after adding the relevant code to functions.php and updating the widget logic, I only got a blank page on refresh).
Is this possible and, if so, please describe what I should be doing?
- The topic ‘Parent and child categories’ is closed to new replies.