ok, i know the post above is 7 months ago, but i thought this would be useful for anyone who got stuck on this problem.
The simple solution to this is to use the Conditional Tag is_search()
. Write a little PHP conditional statement before printing any pages, something like:
<?php if (!is_search()) {echo $children;} ?>
where $children
contains the list of pages that will normally be displayed. This way, the list of pages will only be displayed if the currently showing page is not a search results page.