Hi.
I am trying to do a custom sub-menu in the sidebar. For some reason no matter what I do, I can't seem to get $post->ID or $post->post_parent to return anything.
Here is a simplified version of my function being called for thematic_abovemainasides (0):
function childtheme_sidebar_menu() {
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=1");
if ($children) { ?>
<div id="children-page-list">
<?php echo $children; ?>
</div>
<?php }
}
Only the top level menu items are shown as it never actually gets $post->ID.
I also tried to get the page ID by using $wp_query->post->ID, but that also returns nothing.
What am I doing wrong here?
Thanks!