I was wondering as to how I can list the child of a child pages in wordpress.
Here is what I have set up.
Videos (Parent) -Music Videos(child) --Video 1 (Child of Child) --Video 2 (Child of Child) -Performances (Child) --Video 1 (Child Of Child) --Video 2 (Child Of Child)
I want to list all the "child of child" of the parent page "VIDEOS".
I know this code only list the "child" pages but not the child of childs.
<?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"> <?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?> <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; ?>
I want to do this without having to add anything to my functions.php
What do I need to add to make this happen. I have five child of child pages under the Parent page.