Support » Fixing WordPress » Create a menu with Pages

  • Resolved tabouziane


    I love this but it’s only showing one Page. Is there a way to show all the pages/subpages. I think I need a loop or something?

      if($post->post_parent) {
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      $titlenamer = get_the_title($post->post_parent);
      else {
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      $titlenamer = get_the_title($post->ID);
      if ($children) { ?>
      <h2> <?php echo $titlenamer; ?> </h2>
      <ul>  <?php echo $children; ?>  </ul>
    <?php } ?>
  • The topic ‘Create a menu with Pages’ is closed to new replies.