This code works well to display child pages of the parent page while viewing both the parent page and child page. It doesn't apply the current_page_item
CSS class to the parent while viewing it (and only it, not interested in it being applied while on the children) - any suggestions?
<ul class="subpages">
<?php
if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) {
$parent_title = get_the_title($post->post_parent);?>
<li><a href="<?php echo get_permalink($post->post_parent) ?>"><?php echo $parent_title;?></a></li>
<?php echo $children; ?>
<?php } ?>
</ul>