I've asked a question about listing all sub-pages before:
But all the questions were wrong.
Anyways, I have now simpler question.
global $post; echo $post>ID
Works totally fine, but while on pages sidebars only. When it's next to the blog loop (in a blog section) it goes crazy, for example Blog has ID of 216 (and $post>ID in loop.php shows 216), but the $post>ID in the sidebar shows 87. Why is this happening? How to fix that?
I have a suspicion that loop and sidebar are both included in index page separately and loop is getting different post ID than sidebar. The big question is how to change that.
[edit for Rarst]
wp_reset_postdata(); global $post; $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0'); echo $children;
Gives the same result. It works with pages, not blog. I have a normal loop, as like in Twenty Ten for example.