Im using the following query on some of my 'parent' pages to show the links to all of its child pages:
<?php $child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?> <?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild ); ?> <div class="child-thumb"> <a href="<?php echo get_permalink($pageChild->ID); ?>" rel="bookmark" title="<?php echo $pageChild->post_title; ?>"><?php echo $pageChild->post_title; ?></a> </div> <?php endforeach; endif; ?>
That works fine but what im wondering is how i could adapt that code to show all the child pages from the parent actually on the child page.
So when i go to a child page it shows the links for its siblings...