Last active
August 29, 2015 14:22
-
-
Save samholguin/62080432382b55c4f46c to your computer and use it in GitHub Desktop.
WordPress - Function - Get child pages
This file contains 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
/** | |
* Get child pages | |
* | |
* @access public | |
* @return array | |
*/ | |
function shgist_get_child_pages() { | |
global $post; | |
$args = array( | |
'post_parent' => $post->ID, | |
'post_type' => 'page', | |
'posts_per_page' => -1, | |
'post_status' => 'publish' | |
); | |
return get_children( $args ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment