Change the depth
parameter to how many levels you want the walker to traverse.
From the docs depth parameter description.
Number of levels in the hierarchy of pages to include in the generated list. Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to the given n depth). Default 0.
Let us say 2 as the depth level , it outputs both SubPages and it’s first level children.
<?php
global $post;
$current_page_parent = ( $post->post_parent ? $post->post_parent : $post->ID );
wp_list_pages( array(
'title_li' => '',
'child_of' => $current_page_parent,
'depth' => '2' // Traverses SubPage and it's first level children
)
);
Related Posts:
- How can I hide children of draft pages using wp_list_pages()?
- How to List All Pages (With their template names) Within a Website
- How can I list all pages with their templates?
- Add Parent to List of Subpages
- get all page IDs from wp_list_pages
- Add class to the items in wp_list_pages
- Display grandchildren on child and grandchild pages using wp_list_pages
- Load parent pages when there are no child pages
- create shortcode to show children if any otherwise siblings
- dynamically limit depth of wp_list_pages
- Conditional styling of wp_list_pages bullet points [closed]
- Setting multiple values to as sort_column
- wp_list_pages – Using a Walker to customize output order
- Custom category listings
- How can I include private pages in a page list?
- Do Not Display Parent Page if No Subpages
- Arrange Combined List of Pages and Categories
- List pages within a certain parent and show published month
- Change Parent Name with wp_list_pages?
- List all Posts under heading in wp_list_pages menu
- $item->url not retrieving url in custom walker?
- List subpage of subpage
- wp_list_page with something like showpost
- How can I list all page titles and IDs?
- Hide Parent if No Children
- Add Parent to Subpage List
- active parent page when clicked on childpage
- alternating classes on wp_list_pages
- remove auto generated pages from the menu?
- Inset image thumbnail from page into list
- How to prevent custom walker from creating sub navigation for pages that are not relatives of the current page?
- Exclude current page in wp_list_pages
- Sub Navigation in Sidebar
- wp_list_pages bug in “number” parameter
- Targeting specific instane of wp_list_pages
- Renaming wp_list_pages class
- wp_list_pages issue/bug?
- WordPress get_pages sub nav show current page
- Change class name in WordPress wp_list_page nav
- Non page link in wp_list_pages
- only display Pages which have children
- add a.parent in wp_list_pages
- wp_list_pages by taxonomy?
- wp_list_pages Format only on Recently Modified Pages
- Adding custom class names to anchor in wp_list_pages
- Walker Class : extract function and wp_list_pages
- Exclude pages by custom field (with yes/no) storing wrong data?
- What’s the WordPress way to get custom HTML for child pages list (with a second relative link)? Currently running regex over wp_list_pages() output
- Return parent post with its children using WP_Query?
- Show just one level of child pages, wp_list_pages woe
- Shortcode producing headers already sent error
- Highlighting current item of custom post types’ sub pages, listed by wp_list_pages
- How to hook wp_list_pages?
- Is there a way to make a custom Page type?
- How does wordpress calculate the page depth?
- Test if page is child and has children, if so echo child pages also on grandchild pages
- Ways to give a wp_list_pages menu link specific class names?
- How to show only parents subpages of current page item in vertical menu?
- Change ul class=”children” for wp_list_pages?
- How to add active class to custom menu using while loop and wp_list_pages
- how to properly list child pages in sidebar?
- wp_list_pages – show pages immediately 1 level below current level
- Add filter to wp_dropdown_pages() or wp_dropdown_categories() – no select container?
- Exclude pages with certain template from wp_list_pages
- Custom Post Type Name Causing Problem
- Adding span tags within wp_list_pages list items
- Check whether the child page has siblings
- inserting custom li class to wp_list_pages
- Handling complex multi-level architecture / menu for large site
- No link on empty page in wp_list_pages
- How to get a list of all recently published child pages?
- Manipulate Output of wp_list_something: select menu instead of li’s
- wp_list_pages sort order is different for different languages [closed]
- Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
- How to echo excerpts with wp_list_pages?
- Extra title output with this function wp_list_pages
- wp_list_pages: only show subpages on the parent page?
- wp_list_pages(); Change output of hyperlink
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- List child pages of specific page using shortcode
- Add anchor text to php
- Pages inside a page (with thumbnails)
- Make wp_list_pages print slugs instead of titles
- I need ideas for a complicated menu
- list pages using page.php and NOT page-{slug}.php
- How to get specified parent page title in my function
- Highlight another nav item
- How would I add the comment count to this sub-pages of current page snippet
- Listing child pages depending on user capability (role)
- Show siblings (if any) and parents
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- Populate meta select box with child pages
- List child pages by slug not ID?
- Drag posts and pages so you can sort them in order
- Menu with parents, children and or siblings pages display
- wp_list_pages() but only show children on the branch you are on
- wordpress wp_list_pages help
- Append a code when at the current page in wp_list_pages()
- wp_list_pages to show all pages on all sub pages
- Combine get_page_by_title to exclude pages from wp_list_pages