What will happen if there are submenus of submenu?
For example:
main
|----subposition
|----subposition
|-------- sub-subposition
|-------- sub-subposition
|----subposition
When you enter the page “sub-subposition” variable $wp_query->post->post_parent gives you ID of subposition, not main… Am I right?