How to show only parents subpages of current page item in vertical menu?

Finally, I solved it myself. Here is the solution: In functions.php: function show_all_children($parent_id, $post_id, $current_level) { $top_parents = array(); $top_parents = get_post_ancestors($post_id); $top_parents[] = $post_id; $children = get_posts( array( ‘post_type’ => ‘page’ , ‘posts_per_page’ => -1 , ‘post_parent’ => $parent_id , ‘order_by’ => ‘title’ , ‘order’ => ‘ASC’ )); if (empty($children)) return; echo ‘<ul class=”children … Read more