$parent_id, 'sort_column' => 'menu_order, post_title', 'sort_order' => 'ASC', ]); if (empty($children)) return; $indent = str_repeat(' ', $depth); echo $indent . ''; } } $current_id = get_the_ID(); $root_id = wp_get_post_parent_id($current_id) ?: $current_id; ?>