Wordpress listing subpages

Hi guys,

can someone help me out with this please.

I am trying to display related subpages on every subpage as opposed to just have subpages displayed on the parent page
i am using this code which does the trick

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

  <?php echo $children; ?>
  <?php } ?>

however it also displays the subpage that is currently active, is there a way to not display the current subpage in the list but display all other related subpages

thanks

Not too sure, what you are after.
But did you try depth parameter like:

wp_list_pages(array('depth' => 1 , 'title_li' => __('Pages'))); 

thanks, i tried that but it didnt work :frowning:

basically what i am trying to do is have all related subpages appear on parent page and the subpages

so for example here is my pages

Parent Page
-child 1
-child 2
-child 3

on the parent page i see a list of all the childpages which is correct

on the childpages i also see a list of all the childpages

so if im on child 1 childpage i see pages
child1
child2
child3

but what i want to do is not have a link of child1 as this is the active page
hope that is clearer

still havnt figured this out :frowning:

Easy: add exclude=$post->ID to your query

i can’t do that unless it picks up the current page ID??

because im using it in my page.php file…all the pages use the same file so i can’t exclude certain pages, apart from doing a huge if statement, but thats not very practical as its for a client who will be adding more pages later :frowning:

any tips?

how do i go about creating an if statement if that is the only option?:goof: