My question relates to showing the parents and siblings of the current page.
If I am on level 2 page, I would like to show siblings without their children. If I am on level 3 page, I would like to show siblings, parent and parent's siblings.
For example if I would have page levels like this:
Animals (level 1)
- Fish (level 2)
-- Salmon (level 3)
-- Trout
-- Pike
- Mammals
-- Dogs
-- Cats
Plants
If I am on the page Fish, I would like to show siblings:
Fish
Mammals
If I am on the page Salmon, I would like to show siblings, parent and parents siblings:
Fish
- Salmon
- Trout
- Pike
Mammals
My current code looks like this:
<?php
if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&sort_column=menu_order");
else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&sort_column=menu_order");
if ($children) { ?>
<ul><?php echo $children; ?></ul>
<?php } ?>