Hello,
I am adapting WP as a CMS for our libraries website... the issue I have is that, on the furthes most pages of a branch (of the tree), there are no children... this makes my navigation look bear... I want to show the children of the previous layer (IE... The same NAV that was on the page that led to the outermost page)
my code is:
<?php
// Get $post if you're inside a function
global $page;
if (is_page() && $post->post_parent ) {
// This is a subpage
echo "<ul>";
wp_list_pages('depth=-2title_li=&&child_of='.$post->ID.'&echo=0');
echo "</ul>";
}
?>
<?php
$children = wp_list_pages('depth=-2&title_li=&&child_of='.$post->ID.'&echo=0');
if ($children) { ?>
<!--[if IE]>
<style> .highlight_2_col{margin-left: -00px !important;}</style>
<![endif]-->
<div id="children">
<ul>
<?php echo $children; ?>
</ul>
</div>
can anyone help?
Thanks,
Wes Crockett