This plugin has helped me numerous times… and is a function that I’ve thought should be a part of the WordPress core for a long time. Anyway… this is not my plugin so I CANNOT give any extra advice or bugfixes.
A colleague of mine – Aaron Affleck – fixed a bug in the ‘is_child_getParents()‘. In the SQL statement, the table name was wrong, the column name trying to be accessed was wrong and the statement was missing an assignment operator.
The original author is Eric Range, and his website has been down for a while. I’m just hosting a copy of the plugin here for everyone else’s use.
This plugin checks if current page, posting or category is in direct or recursive relation with a specific parent category or parent page.
Checks if the current page, posting or category is somehow related to category- (or page-)ID 10.
Checks just if the current element is a direct child of Example Category.
Checks if the current element (page) is somehow related to a page with the slug some-page.
- DOWNLOAD THE PLUGIN: is_Child WordPress Plugin (534 downloads)