Here is the code to solve the issue:
File: template-functions-post.php
Function: wp_list_pages(args = ”)
Line: 358 (aprox.)
Add next code (into the “foreach” code block):
$page_tree[$page->ID]['parent'] = $page->post_parent;
———————————–
Into the same file:
Function: _page_level_out(…)
Line: 418 (aprox.)
Add next code (into the “foreach” code block):
$current_page = $page_tree[$GLOBALS['id']]['parent'];
if(!($parent == 0 || ($GLOBALS['id'] == $cur_page['parent']) || ($current_parent == $cur_page['parent'])))
continue;
———————
I hope you’ll find it useful. Regards.
—
Diego Lago