Using the code below, how can I display only the immediate set of children associated with the current page and not the children's children or the other parents on the tier of that page. I assume that the depth parameter is a part of the solution however, I'm unsure as to how to best implement it. Also, does the depth refer to the hierarchy in an absolute or relative fashion. I'd like for it to show only 1 level of depth relative to the page that is selected.
Thank you much for the help and if I can offer any clarification, please let me know.
<?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) { ?>
<ul>
<?php echo $children; ?>
</ul>
<?php } ?>
depth is used in this way:
What happens if you use this one?
from documentation:
depth: (integer) This parameter controls how many levels in the hierarchy of pages are to be included in the list generated by wp_list_pages. The default value is 0 (display all pages, including all sub-pages).
0 (default) Displays pages at any depth and arranges them hierarchically in nested lists
-1 Displays pages at any depth and arranges them in a single, flat list
1 Displays top-level Pages only
2, 3 … Displays Pages to the given depth
.