Firebug – a usefull Firefox Add-on

Unfortunately, in_category doesn’t understand category child-parent relationships. If, for example, category 11 (bananas) is a child of category 2 (fruits), in_category(‘2’) will return FALSE when viewing post about bananas.

category AND all its sub-categories

So if you want the same text to be applied to the category AND all its sub-categories, you’ll have to list them all. Syntax like in_category(2,11) is not allowed. You’ll have to use PHP || (logical OR) && (logical AND) in the expression.

Leave a Reply


This site uses Akismet to reduce spam. Learn how your comment data is processed.