Modifying get_posts to display children and grandchildren of current page

I'm trying to modify my existing loop to include also the sub-sub-pages of my Services page.

                global $post;
                $args = array('post_parent' => $post->ID, 'post_type' => 'page', 'posts_per_page' => -1); 
                $custom_posts = get_posts($args);
                foreach($custom_posts as $post) : setup_postdata($post); ?>
                <div class="col-sm-8 col-md-4 service">
                            <h3><?php the_title(); ?></h3>
                        <p><?php the_field('short_description');?></p>
                        <p><a role="button" class="btn btn-primary" href="<?php the_permalink();?>">Learn more</a></p>
                <?php endforeach;

Open in new window

The problem is that when I change it to get_pages, it doesn't display only pages of my current page, but all pages, and with get_posts I don't know how to add grandchildren in the parameters. Can someone help? Thank you!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

>The problem is that when I change it to get_pages, it doesn't display only pages of my current page, but all pages,
Here is an example using get_pages():
global $post;
$mypages = get_pages( array( 'child_of' => $post->ID ) );

// If $post->ID is NULL, you can try the following:
$page = get_page_by_title( 'Title of your service page' );
$pageid = $page->ID;

$mypages = get_pages( array( 'child_of' => $pageid ) );
foreach ( $pages as $page ) {

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.