Return to Snippet

Revision: 59065
at August 16, 2012 03:35 by klagraff


Initial Code
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
};

Initial URL

                                

Initial Description
Add this to functions.php to enable the page-child function is_tree

Initial Title
Adding is_tree functon to WordPress

Initial Tags
wordpress

Initial Language
PHP