Navigation menu with children shown only for current page
If you dont mind using a plugin I can tell you how I have gotten this to work in the past. Add the following code to your functions.php function get_root_parent($page_id) { global $wpdb; $parent = $wpdb->get_var(“SELECT post_parent FROM $wpdb->posts WHERE post_type=”page” AND ID = ‘$page_id'”); if ($parent == 0) return $page_id; else return get_root_parent($parent); } … Read more