I am currently using this snippet to show children of the current page.
<?php wp_list_pages('title_li=&child_of='.$post->ID.''); ?>
when I click one of those children pages the sub nav disappears because there are no child pages of the current page, so what I need it to do is continue to show the sister pages of the current page.
What is the best way to do this?
You could request the parent ID instead of the post ID if there is no childs on the current page :
get_page_children
is used to check if there is any child for the current page – theWP_Query
part is needed forget_page_children
which required an array of all the pages to look in.