Hello all!
I'm using the following code to list child pages as a sub navigation in my sidebar.
<?php /* Creates a menu for pages beneath the level of the current page */
if (is_page() and ($notfound != '1')) {
$current_page = $post->ID;
while($current_page) {
$page_query = $wpdb->get_row("SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
$current_page = $page_query->post_parent;
}
$parent_id = $page_query->ID;
$parent_title = $page_query->post_title;
if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_status != 'attachment'")) { ?>
<ol>
<?php wp_list_pages('sort_column=menu_order&title_li=&child_of='. $parent_id); ?>
</ol>
<?php } } ?>
Problem is, it doesn't work on the page I have designated to be the Posts page. In the hierarchy, this page is a child of a parent page. To see what I'm talking about, this is the site I'm working on: http://cjdschool.org/connect/news. That link is specifically the one I'm having trouble with.
From searching around, I've pretty much gathered that WordPress doesn't let index.php be a child/have a child? Is that right? Meaning that the reason the list isn't showing up is because that page is designated as not having any parents or children.
If that's right, the only thing I can think of doing is making a new template, deactivating that page from being the Posts page, and adding in some code to pull posts anyway? Would that work? If so, does anyone have any idea of that that code could be?
Many, many thanks in advance