Why isn't the conditional function is_tree() a CORE part of WordPress? Why do I have to add it to use it?
If you've EVER struggled over trying to make dynamic sidebars or includes or any other changes that should propagate to a page and it's children, check out is_tree(); IT ROCKS and it SHOULD be built into the program by default, imo.
http://codex.wordpress.org/Conditional_Tags (scroll down to snippet4)
Here's the function, but you have to add it to use it per instructions on the Conditionals Tags page:
function is_tree($pid) { // $pid = The ID of the page we're looking for pages underneath
global $post; // load details about this page
if(is_page()&&($post->post_parent==$pid||is_page($pid)))
return true; // we're at the page or at a sub page
else
return false; // we're elsewhere
};
Vote here: http://wordpress.org/extend/ideas/topic.php?id=3139