Hi,
I am using an If, Else structure that checks to see if there are subpages for the current page and adds a subnav to my sidebar. I can get it to work perfectly until I click on the third or more level in - then the nav disappears. This is the logic I have:
<?php if (is_page(9)) { ?>
<li><a class="current_page_parent" href="/index.php?page_id=9">Who</a>
<?php } else { ?>
<li><a href="/index.php?page_id=9">Who</a>
<?php } ?>
<!--check for Who (ID = 9) subpages-->
<?php if (is_page(9) || $post->post_parent=="9") {
if($post->post_parent)
$children = wp_list_pages("sort_column=post_date&title_li=&child_of=".$post->post_parent."&echo=0"); else
$children = wp_list_pages("sort_column=post_date&title_li=&child_of=".$post->ID."&echo=0");
if ($children) { ?>
<ul>
<?php echo $children; ?>
</ul>
<?php } } ?>
</li>
Any ideas? Thanks!