I have a vertical nav on my wordpress site, which is currently outputting all parent pages, and chidren within them. I am using the following code to achieve this:
<ul id="navlist">
<?php wp_list_pages('sort_column=menu_order&title_li=&echo=1'); ?>
</ul>
This produces:
<ul id="navlist">
<li><a href="/" title="Home">Home</a></li>
<li id="who-we-are"><a href="/who-we-are/" title="Who We Are">Who We Are</a>
<ul>
<li id="who-we-are_our-history-philosophy"><a href="who-we-are/our-history-philosophy/" title="Our History & Philosophy">Our History & Philosophy</a></li>
<li id="our-team"><a href="who-we-are/our-team/" title="Our Team">Our Team</a></li>
</ul>
</li>
</ul>
What I need to know is how to hide the child pages (the nested UL) if the visitor is not on the parent page.
So in my example - if the visitor isn't in the parent page of WHO WE ARE, they wont see the links OUR HISTORY or OUR PHILOSOPHY.
Help is much appreciated!