0

I'm working on a custom page template that display child pages in a parent page with pagination.

It is working, but the header, and footer are not properly displayed. But when I removed the PHP file of the custom page. The header and footer are back to normal.

What's wrong with my PHP code?

Here's the snippet:

<?php
$ids = array();
$pages = get_pages("child_of=".$post->ID);
 if ($pages){
    foreach ($pages as $page){
    $ids[] = $page->ID;
    }
}
$paged = (get_query_var("paged")) ? get_query_var("paged") : 1;
$args = array(
    "paged" => $paged,
    "post__in" => $ids,
    "posts_per_page" => 5,
    "post_type" => "page"
);
query_posts($args);
if (have_posts()) : while (have_posts()) : the_post();
?>
<div>
 <h3><?php the_title(); ?></h3>
 <div><?php the_date(); ?></div>
 <p><?php the_content(); ?></p>
</div>
<?php endwhile; ?>
<?php endif;
 paging_nav();
 wp_reset_query();
?>
4

0 に答える 0