Jennifer Zelazny May 13, 2009 0 Comments The need to show all posts in a particular category or that category’s sub categories is very high. There are not too many projects out there that do not require a customized search, a menu, or a listing of some sort where the user wants to include all posts (or exclude) that belong to a parent category. Until recently – there was no real good way to do this. You either had to hard code category names or IDs in an array, or get really creative. I recently started using the following function mentioned in the WordPress Codex that made this very easy: post_is_in_descendant_category(). By using that function – you can test to see if a post is in a particular category or even several subcategories deep of that category and then use that to easily show exactly what you want. Examples and documentation for post_is_in_descendant_category: http://codex.wordpress.org/Template_Tags/in_category Tagged: post_is_in_descendant_category, Wordpress, WordPress functions, WordPress Wednesdays Leave a Reply Cancel ReplyYour email address will not be published. Comment Name * Email * Web site Notify me of follow-up comments by email. Notify me of new posts by email. Δ This site uses Akismet to reduce spam. Learn how your comment data is processed.