In order to reduce the number of template in my theme I am using some conditional statements to change things on my pages. I am currently using this in my sidebar:
<?php
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
if ($children) { ?>
<h2><?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?> Pages</h2>
<ul>
<?php echo $children; ?>
</ul>
<?php } else
wp_get_archives();
?>
Basically this checks to see if the page has child pages, and if so it lists the child page links. If it doesn't have a child page then it list the archives.
My problem is, is that I want it to list the posts titles from a certain category in an unordered list (wrapped in <ul> tags so that it displays correctly) if the page doesn't have child pages.
Can anyone help me out on how to do this. The codex is full of example of conditional uses but none quite seem to match what I am looking for.
Thanks in advance.