function is_tree (from docs: “Conditional Tags”)
-
Hi!
I was reading the doc about conditional tags and decided to add the is_tree() function to my theme. So, as proposed, I added the snippet 4 to my themes functions.php.
Looks like:
<?php if ( function_exists('register_sidebars') ) register_sidebars(2); ?> 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 };
But now on the top of my page I see the text of the added function.
Seems like I added just a textparagraph. Am I missing something?
Anyone who can explain to me how to add this function properly to my functions.php?any help appreciated,
cya, piedro
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘function is_tree (from docs: “Conditional Tags”)’ is closed to new replies.