WordPress sibling pages

Output siblings to the current page:

<?php
global $post;
$current_page_parent = ( $post->post_parent ? $post->post_parent : $post->ID );
 
echo '<ul>';
wp_list_pages( array(
	'title_li' => '',
	'child_of' => $current_page_parent,
	'depth' => '1' 
) );
echo '</ul>';
?>

Leave a Reply

Your email address will not be published. Required fields are marked *