I'm trying to list out all the child pages of a custom page I've made.
In my custom page, I'm doing this to list out the pages:
<?php get_header(); ?>
<?php
$subpages = new WP_Query( array(
'post_type' => 'page',
'post_parent' => $post->ID,
'posts_per_page' => -1,
'orderby' => 'menu_order'
));
if ($subpages->have_posts()) : while ($subpages->have_posts()) : the_post(); ?>
...
<?php endwhile; else : ?>
...
<?php endif; ?>
<?php get_footer(); ?>
But this isn't working. Now it only lists out itself (the parent, which I don't want listed out at all), and none of its children.
Also, the sites just keeps loading, while everything except the footer is displayed. It's like its returning one half of the page, and then hangs as it works on the rest. While running this my CPU and fan suddenly kicks in.
Does anyone know why?