quagliato
8/5/2013 - 2:14 PM

Iterate children pages

Iterate children pages

$query = new WP_Query();
$all_pages = $query->query(
    array(
        'post_type' => 'page', 
        'orderby' => 'post_title', 
        'order' => 'ASC', 
        'posts_per_page' => -1));

$children = get_page_children(get_the_ID(), $all_pages);

foreach($children as $child) {
     $page = get_post($child->ID);
}