I'm developing a website in which child pages have a section displaying randomly its related pages which are its own siblings. They all have the same parent page.
Further explaining:
Parent page
- Child page (shows related pages - its siblings)
- Child page (shows related pages - its siblings)
- Child page (shows related pages - its siblings)
- Child page (shows related pages - its siblings)
Also, this display must be random, so that each page display will show a different range of related pages.
I'm imagining there might be a way to extend the wp_list_pages() in such a manner to display siblings. What I use in the parent page to display all children is:
<?php
wp_list_pages( array(
'title_li' => '',
'child_of' => $post->ID
));
?>
I need this because I don't want to install a plugin to add category to pages so that I can use an existing related posts/page plugin. Another solution would be the existence of a plugin that allows related pages to be siblings (I didn't find one... most use taxonomy).
Here's what I needed: