You could try to remove them, but maybe it’s easier to not generate them in the first place. The page list is displayed by a Walker. This is a class that “walks” over all the items in the tree, and displays them. wp_list_pages()
by default (via walk_page_tree()
) uses the Walker_Page
class, which displays everything in <li>
elements. However, you can duplicate this class, remove everything it in you don’t need, and pass that class to wp_list_pages()
(with the walker
argument).
Related Posts:
- start_lvl Ignored in Custom walker_nav_menu
- Hide main div if wp_nav_menu is empty
- Menu Items Disappearing
- wp_delete_auto_drafts() deletes links in menus
- Check if a menu is empty?
- How to remove a metabox from menu editor page?
- Walker class: Problems with understanding how walk() method can be called without error
- How to Use the Function is_user_logged_in To Display Different Menus?
- Replacing a specific menu item
- How to create different menu’s for not logged in visitors and for logged in members?
- How to add active class to custom menu using while loop and wp_list_pages
- How can I access the “description” of a menu item?
- How to place login logout link on menu that redirects users back to current page?
- How can I add a class to a single menu item?
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- items_wrap not working
- Style wp_page_menu() items
- wp nav menu: add attributes to menu items [duplicate]
- Have CSS Class Added with `is_page()` WP function
- Run a filter when a walker runs
- Change Navigation Bar based on logged in or not
- Multiple WordPress Menus that will only display all pages
- Input type search in Menu
- WP Walker using custom css classes
- Change list item content in menu navigation to add a child element with specific class
- How can I Add a variable PHP in the Menu Nav
- Where to place PHP code that inserts (or doesn’t insert) menu item?
- Adding an Avatar to the Top Nav Bar
- Unique icons next to each WordPress menu item
- Child page menu in sidebar
- Title Case WordPress Menu Items
- Trying to store submenu items to render out after main menu
- How to change menu order item
- get_the_title() gets printed out twice
- Two menus show up
- Register a menu – Error Header
- Show About and Contact Us page when they’re clicked in the top menu.
- Parsing Menu Items and Blog Posts
- Add login hyperlink to secondary navigation menu
- wp_nav_menu not working correctly in my underscores theme
- Dropdown menu for categories
- How to display different submenus?
- Get the name of menu item with wp_nav_menu
- How to use wp_nav_menu to create custom dropdown menu?
- Output only links using wp_nav_menu()
- Get css class of menu item in custom menu structure
- How to add aria role and schema markup to custom walker container
- Show login greeting above sub-menu links?
- Why can’t I add a custom image in my navigation?
- Remove submenu item from list
- conditional: if is page, and all subpages
- How to tell if a user has gone in and created a menu
- Remove the Tag from wp_nav_menu
- Menu not styling. New menus functionality giving me a headache
- Add class to ul and li in wp_na
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- Providin exception to WordPress wp_nav_menu Custom CSS Classes
- Adding markup to sub menu based on class
- Replace jQuery with PHP or CSS for Customized WordPress wp_nav_menu
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- How to put 2 php codes in functions.php without site crashing
- Menu not updating for logged in users after redirect
- wp_get_nav_menu_items() with ACF
- How to switch between two primary menus (programatically0
- Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]
- How to give custom roles the capability to edit one Menu instead of every Menu
- Primary navigation menu with timed items from custom post type
- Difference between “Walker_Nav_menu” and “walker”
- Add parent menu item in sub-menu in custom nav_walker
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Vertical Menu for one page only
- How limit the width of a fixed menu-bar on scroll?
- Pulling a variable into the wp_nav_menu function
- How to list categories by page id in wordpress
- Two theme locations for two menus, but only one is showing up
- wp_nav_menu doesn’t work in a duplicate server
- How I can add div to menu?
- wp nav menu without label
- Contact form field in wordpress menu
- Add extra markup to WP menus
- How to call a certain object/menubar in a PHP file
- Sidebar current menu item for parent
- Using ‘array’ method in wp_nav_menu causes it to disappear
- Remove all nav menu classes except those which begin with certain letters
- How to add a code for lastpostdate after/inside a specific menu link?
- Add the “.current-menu-item” class to tag?
- WP_Nav Highlight Parent Issue
- WordPress adding in site URL to header links
- How to change the menu color
- if is_home(), change class of menu-item-225 of wp_nav_menu
- Nav Menu Display
- Adding a unique class to wp_nav_menu
- Change order that the menu is generated with wp_list_pages
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- How do I modify the with wp_nav_menu()
- Make a permalink to the most recent blog post
- Inserting a shortcode into a genesis menu?
- Custom Navigation Bar JSON Syntax Error in JSON at Position 0
- How to add different menu items on different menus?
- Nav menù doesn’t display selected pages