I'm working on a Wordpress website. The below code shows the children pages of the current parent page that you're on.
//Set up the objects needed
$my_wp_query = new WP_Query();
$all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));
//Get children
$children = ($post->post_parent) ? get_page_children( $post->post_parent, $all_wp_pages ) : get_page_children( $post->ID, $all_wp_pages );
//Build custom items
foreach($children as $child){
?>
<a style="text-decoration:none;" href="<?php echo get_permalink($child->ID); ?>" class="live-slider" title="#caption1">
<div class="header-title"><?php echo get_the_title($child->ID); ?></div><br/>
<div class="header-subtitle"><?php echo get_the_subtitle($child->ID); ?></div>
</a>
}
The problem that i'm having at the moment is that I want to be able to show the child pages of a specific parent page on all parent pages.
For example, I have a parent page called Subscriptions which has 4 children pages. I want these 4 children pages to also appear on each other parent page using the same code above if possible.