/ Published in: PHP

Add this to functions.php to enable the page-child function is_tree
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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 };
Comments
