hsquareweb
6/5/2012 - 9:51 PM

WP: Display children of parent page

WP: Display children of parent page

<div class="side-nav">
	<?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) { ?>
			<ul>
				<?php echo $children; ?>
			</ul>
	<?php } ?>
</div>