When you use include
parameter of wp_list_pages you are basically telling it to only include these certain Pages in the list.
you should use exclude_tree
instead, when using this parameter it will exclude a parent and all of that parent’s child Pages.
so something like:
$top_pages_to_exclude="1"; // the top page to be excluded ID, you can specify more then one '1,2,23'
$args = array(
'sort_column' => 'menu_order',
'depth' => 2,
'title_li' => '',
'exclude_tree' => $top_pages_to_exclude
);
wp_list_pages( $args );
Related Posts:
- wp_nav_menu: show menu only if one exists, otherwise show nothing
- Number of items in a menu
- Can this navigation be done easily in WordPress?
- Set if condition with wp_nav_menu
- Auto add pages to primary menu with functions.php
- Disable most recent & view all (TABS) on nav-menu.php
- Change an li class name in a wordpress custom menu walker
- Home Custom Menu Link not Working
- Inserting specific images inside navigation menu
- Programmatically add existing pages and subpages to Appearance Menu
- two different separate sections on the same site
- Does is_child() exist in wp 3.5.1?
- How to add rel=”nofollow” to wp_list_pages?
- How can I add a delay to the collapsible menu in Twenty Eleven?
- How to get main menu only with wp_nav_menu
- wp_list_pages Hierarchical Help
- Add pages content to startpage through custom menu
- Remove the Tag from wp_nav_menu
- wp_nav_menu: output featured image of each page listing
- How can I order these pages in this navigation bar on this old wordpress theme?
- Unable to remove page from primary menu
- Walker_Nav_Menu Add Strings and Class Name
- Add default wp_nav_menu classes to my custom links
- Page and Posts loading as index page? Not loading the content
- How to add class and span to
- How can I set the first link in my nav menu to simply be a drop-down to some other pages
- how can i get the page_ID in nav li [closed]
- Add infinite scroll to content splitted post
- Programmatically add a Navigation menu and menu items
- Dynamically exclude menu items from wp_nav_menu
- wp_nav_menu(), how to change class?
- Split up wp_nav_menu with custom walker
- How to give paged links custom title?
- Is there an easy way to replace a custom menu link with a page or post?
- Apply the_title() filter in post & page title, but not in menu title
- Get the ID of the page a menu item links to?
- How to display by default only published posts/pages in the admin area?
- Mega Menu Walker
- Change the_title() of a page dynamically
- How to Add to Each Menu Link with link text to data-attr?
- Listing pages which uses specific template [duplicate]
- Add Javascript to WordPress Menu
- Filter wp_nav_menu()
- Add custom classes to anchor in wp_nav_menu
- How to modify navigation menu of the “My Account” page in WooCommerce
- Custom ID for certain menu item?
- wp_nav_menu: check if the list item has children and add a class to anchor link
- Add data-icon input to WordPress custom menu links
- Displaying Logged-In User Name in WordPress Menu
- Remove current_page_parent nav class from blog index when in CPT
- Remove Container Element From wp_nav_menu() Markup
- Add custom meta to nav menu items
- Add Dividers or Separators Between Nav Menu Items
- Display navigation menu item conditionally based on user capabilities
- Add child pages automatically to nav menu
- Show just one level of child pages, wp_list_pages woe
- Removing link ” from ” menu for some “links” without JS
- Show current navigation path from menu
- Remember the last post I read
- Export navigation menu
- Call custom field into menu item
- Use navigation path from menu for permalink
- Can I display submenus in groups, using wp_list_pages?
- Exclude Private, Draft pages from Primary Nav when using custom menu
- Automatically remove trashed pages from nav menu
- add span class inside wp_nav_menu link anchor tag
- wp_nav_menu always falls back to a menu
- Prev/Next child navigation for current page?
- wp_get_nav_menu_items how to exclude sub level menu items?
- Multi Level Bootstrap Navigation Menu in WordPress
- List child pages of a specific page
- How to set limit only on top levels of wp_nav_menu?
- Determine if a navigation item has children
- What’s the easiest way to duplicate an entire navigation menu?
- How to modify the “after” of last element in wp_nav_menu
- Bootstrap dropdown nav pills not working with wp_nav_menu()
- Show only 2nd level of navigation depending on active navigation
- How to move parent li to end of child ul
- How do I retrieve menu items from one level only?
- How to get a different mobile menu than desktop menu in the twentytwelve child theme
- Add custom attributes to menu items without plugin
- Edit HTML of WordPress navigation bar
- Breadcrumbs showing Parent and Child Pages
- Directing a page to a default subpage
- Add Page ID class to nav menu items
- How to add menu support to a theme?
- Using FlexNav with WordPress [closed]
- How to highlight the right item in the navbar
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- List all pages and children in separate ul
- Can you have different menus and theme on a per-page basis?
- How to manually add an item to a submenu in a menu generated by wp_nav_menu?
- WordPress Export Import Site Navigation Menu
- Assign title-specific class to list items in menu based on WP pages
- Using Image Links in WordPress Navigation Menus Instead Of Text Links
- Links open only on new tab or window
- List children of second level sub page
- Adding Post Counts to Menu (Nav) Programmatically?
- Not able to get current menu ID