Created
October 9, 2014 03:36
-
-
Save robskidmore/57567350cfda171f4174 to your computer and use it in GitHub Desktop.
Test if is page or child of page Wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_tree($pid) { | |
global $post; | |
if(is_page()&&($post->post_parent==$pid||is_page($pid))) { | |
return true; | |
} else { | |
return false; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment