You can use get_page_children
function to retrieve all sub pages
$the_query = new WP_Query( array( 'post_type' => 'page', 'posts_per_page' => -1 ) );
$children = get_page_children( get_the_ID(), $the_query->query() );
if ( !empty( $children ) ) {
foreach ( $children as $child ) {
// render menu
}
}
Related Posts:
- Subpages List Appearing on Every Page
- WordPress two row automatic sub navigation with double wp_list_pages. Is it impossible?
- Custom menu walker: how can i check first item
- How to add a child item to a menu element (using wp_nav_menu_objects)
- Primary and secondary menus
- how to get custom admin submenu( custom post type ) item to highlight when its active
- Handling complex multi-level architecture / menu for large site
- wp_list_pages: only show subpages on the parent page?
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- Walker nav remove submenu ul from a certain depth
- WordPress bootstrap menue with 3. level
- Subnav menu – adapt to show the same on parent, child & grandchildren pages?
- disable menu collapse/expand function and make a menu item a static, unclickable text
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Submenu causes issue in defined blog page
- Define supporting only 1-level menu
- How to target grandchild of post_parent using wp_list_pages
- Get the page IDs of a Particular Menu item’s submenu
- sub-menu does not show on the very top bar
- How to hide Newsletter plugin submenus from the Dashboard?
- How to exclude/remove submenu using Walker_Nav_Menu
- Listing Sub-Pages & Sub-Sub-Pages
- wp_list_pages() not showing on posts
- Links doesnt appear as a submenu on a mobile
- Notices are render inside sub-menu’s content
- Problem add submenu page
- Creating navigation out of specific IDs and their children?
- Controlling the position of dropdow submenu
- Assign index page to my mobile site?
- Restrict days in bootstrap datepicker using checkboxes in submenu
- Need help finding information to create this type of page
- Trouble posting in Sub-Category
- How to display list of child pages with parent in wordpress?
- Active class on side menu
- Display all submenus
- I need to get this sub nav to show up on cat, sup-cat and post
- Horizontal sub-menu on one line
- Add an admin page, but don’t show it on the admin menu
- Add custom html to last sub-menu item
- Exclude one item from wp_list_pages( $args );
- How to List All Pages (With their template names) Within a Website
- Put a wp_nav_menu inside another one
- How to show only parents subpages of current page item in vertical menu?
- Change ul class=”children” for wp_list_pages?
- how to properly list child pages in sidebar?
- Generate a Menu that displays all child pages of top level parent
- Check if wp_nav_menu items have submenus
- Admin Menu – Highlight top-level menu when on a sub-menu page (without showing sub-menu)
- create shortcode to show children if any otherwise siblings
- dynamically limit depth of wp_list_pages
- Extra title output with this function wp_list_pages
- Change top level menu item to point to custom submenu item
- No “current-menu-ancestor” class added when browsing an archive page
- List pages within a certain parent and show published month
- How would I add the comment count to this sub-pages of current page snippet
- Menu with parents, children and or siblings pages display
- add_submenu_page function to show videos table
- How do I add recent posts to the menu?
- Creating a menu containing categories and authors
- Change submenu markup
- Get Parent List Class for Child Pages Using Walker
- get_the_post_thumbnail not working inside wp_get_nav_menu_items hook
- Looking replicate static HTML Menu into WordPress Dynamic Menu [closed]
- wp_list_pages() exclude category
- Add child pages to submenu automatically
- Print Dashboard submenu name and filename
- Additional menu item popping in submenus
- Why WP_Screeen doesn’t show all options with admin_body_class
- Add a sub menu page to the Users menu
- WP List Pages – Add Title Attributes to Anchors
- wp_list_pages Hierarchical Help
- List all pages including archive
- Remove submenu item from list
- An alternative to WordPress’s built-in menu functionality
- Can you exclude child pages of a specific parent within a navigation?
- Is there any way to change the CSS class applied to 2nd level sub menu ul’s?
- Check if page has subpages
- How should I set up a Tumblr blog at a WordPress Page?
- Add Different Class on Different Ul in twenty-twentyone theme
- wp_nav_menu container style args
- How can I click the parent menu then redirect to a special URL?
- wp_list_pages get the hole hierarchy for current page
- Horizontlal scrolling content
- How do I hide submenus from the top menu bar?
- Change font and Colours in Menus
- WordPress menu issue after update
- Displaying a part of a menu containing the page the user is currently viewing and only it’s immediate children
- Role exception for a settings sub menu
- Beyond widget side menu editing, with the php page, custom template
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- Exclude from wp_list_pages by template
- WordPress doesn’t recognize submenus as so I can’t style them properly
- Editing WP Plugin
- Admin menu post type
- Custom post type in submenu with custom meta box as a title with custom html
- WordPress function breaks widget’s markup?
- Subpages menu on sidebar plus widgets
- Add “sub-nav” class to a sub menu parent item
- Walker Class : extract function and wp_list_pages
- nav tag wrapping around dropdown