Created
February 23, 2016 20:10
-
-
Save alandbh/89880caa32ef86bf2be5 to your computer and use it in GitHub Desktop.
Checa se a página atual é uma subpágina ou filha // check if current page is a subpage
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
/* | |
CHECA SE A PAGINA É FILHA | |
*/ | |
function is_child() { | |
global $post; // if outside the loop | |
if ( is_page() && $post->post_parent ) { | |
return true; // This is a subpage | |
} else { | |
return false; // This is not a subpage | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment