Exclude a parent page with get_pages()


I have the following code:

<?php $pages = get_pages('exclude=10'); ?>
<?php foreach ( $pages as $page ) : ?>
    <?php echo $page->post_title; ?>
<?php endforeach; ?>

I would like to exclude page id 10, but I would still like do display its subpages. If I try to include them with the include parameter, they still don’t show up.

Is there a way around this?

pealo86 3 months 0 Answers 12 views 0

Leave an answer