I'm trying to access the page ID of the child so that I can recursively call the get_children function on that child (to get grandchildren).
if ($CurrentPage) {
$args = array(
'child_of' => $CurrentPage
);
$children = get_pages( $args );
foreach ($children as $key => $value) {
echo $key.'=>'.$value.'<br />';
} // End foreach.
} // End IF.
I actually get an error: Catchable fatal error: Object of class stdClass could not be converted to string