Support » Fixing WordPress » in WP 2.8 – Child Pages Template no longer works

  • Resolved brmecham


    I upgraded to WordPress 2.8. Now my Child Pages template doesn’t correctly list the child pages.

    I made a custom page template that uses code straight from the WP Codex:

      $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
      if ($children) { ?>
      <?php echo $children; ?>
      <?php } ?>

    That’s from:

    In 2.7.1 that child pages template worked fine, which made it so when I was viewing the parent page it would show a list of all child pages.

    For some reason now it just shows a list of my Blogroll!!!

    Any ideas on how to make this work in 2.8?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey, not sure if this is exactly what you were looking for, but I had to do the same thing to my site. The following code worked for me. It shows the child pages, and if it is on the last child it will show all of the pages of the parent page. I had to combine two different kinds of old code, it’s not the prettiest but gets the job done.

      global $id;
      global $post;
      $navpages = wp_list_pages("title_li=&child_of=$id&depth=1&echo=0");
         echo $navpages;
      } else {

    Let me know if it worked for you.

    I had no problem using the code listed by brmecham at 2.8 using the WordPress Default theme, putting the code in a Page template inside The Loop.

    the original code from codex doesn’t work for me too,
    if in the loop or outside -nothing 😉

    but your code works like a charme @bvbaccelerate

    thanks a lot!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘in WP 2.8 – Child Pages Template no longer works’ is closed to new replies.