Created
November 17, 2012 22:50
-
-
Save ataylorme/4100978 to your computer and use it in GitHub Desktop.
Is subpage function
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_subpage($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 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment