Solved it with generous help using join()…
function start_el(&$output, $page, $depth = 0, $args = array(), $id = 0) {
if ( $depth )
$indent = str_repeat("\t", $depth);
else
$indent="";
extract($args, EXTR_SKIP);
$output .= $indent . '<li id="item_'.$page->ID.'" class="'.join( " ", get_post_class( "", $page->ID )).'"><span>'.apply_filters( 'the_title', $page->post_title, $page->ID ).'</span>';
}
Related Posts:
- What is a good resource to find out about making custom walkers?
- Comment Walker vs. Comment Callback
- Why is my menu order not working with wp_nav_menu?
- Incrementing a class in a custom walker
- Adding ul class with wp_list_categories Custom Walker
- Indirect modification of overloaded property WP_Post::$classes has no effect
- how to conditionally add attributes to start_lvl() function?
- Menu location by menu id or menu ID in start_el() Walker
- Adding dynamic content to end_lvl in Walker Class [closed]
- Walker gives additional taxonomy name?
- $args->has_children not working with start_el()
- Limit Custom Crawler to front end only
- ol children instead of ul children
- Extend Walker Class for 2 checkbox taxonomy selection?
- using walker menu to add classes and attributes to elements
- Custom megameu walker need improvement
- List pages to show only Whitelisted sub pages
- Get Parent List Class for Child Pages Using Walker
- Manual use of Walker_Category class
- How do I get_the_content in a custom walker?
- Creating Custom navigation in wordpress with sub menus
- Page thumbnail doesn’t display on navigation
- How to remove ul & li from wordpress custom walker?
- Is it possible to display the Navigation Menu without using Walker_Nav Class
- Walker_Category – not reliably saving
- Custom Walker menu depth opening problem
- How to append something before final tag in walker class?
- Using wp_list_categories or other function inside a menu walker?
- Walker to add Bootstrap markup for wp_list_pages
- Custom walker pulldown display current page
- Menu items description? Custom Walker for wp_nav_menu()
- Custom Walker: how to get ID in function start_lvl
- How to mark every 3rd post
- Split up wp_nav_menu with custom walker
- Custom Nav walker display current menu item children, or siblings on no children
- Add a custom walker to a menu created in a widget
- Using a menu walker add a custom item at the end of the menu’s items
- Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu
- Mega Menu Walker
- How to count nav menu items?
- How Does The Walker Class Work?
- start_lvl Ignored in Custom walker_nav_menu
- Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?
- How to specify a class added to my gallery
- Add Caret to Menu Items with Sub-Menus in WordPress Theme
- Custom menu walker: how can i check first item
- How does a minimal menu walker look like?
- Display only page specific sub menu items using Custom Walker
- How do I dynamically populate wp_nav_menu from a custom taxonomy?
- Assign posts to taxonomy terms instead of the taxonomy terms to posts?
- Strict Standards Error bootstrap navwalker
- WordPress Menu Custom Walker Class
- How to create this custom menu walker?
- WordPress 4.4+ breaks Walker Extension
- Call custom field into menu item
- Child Pages Loop
- add span class inside wp_nav_menu link anchor tag
- How to add classes to post_class?
- Add class to top level menu item if it has multiple child levels
- Determine if a navigation item has children
- List Hierarchical Term List with Count with Related Term
- Category as Class for Custom Post Type
- Custom Nav Walker menu – Display category count
- Any walker causes blank menu?
- Extend walker class with custom post types [closed]
- How do I add a custom body class for a specific page ID?
- How do I pass an argument to my custom walker?
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- WordPress: How to use post_class() in an echo
- Simple Navigation Walker – Wrapper-class around first sub-menu
- Custom Nav Walker menu – Display children count
- Add Page ID class to nav menu items
- Using string instead of object class instantiation on the walker argument breaks wp_nav_menu
- Add a different class name to each sticky post?
- automatically placing custom post types singles into submenu of main nav menu
- Pass a parameter to a menu walker
- Adding attributes to link in wp_nav_menu using custom Walker function
- Get parent category class in post_class()
- Walker_Nav_Menu: put custom code between a particular
- Remove and add class with body_class() function
- Walker class: Problems with understanding how walk() method can be called without error
- Adding Post Counts to Menu (Nav) Programmatically?
- Show top-level parent with submenu menu walker
- Adding a class (arrows) to main menu links that have children?
- adding a custom css class to post
- Term Checklist Walker – Disable Parent Categories
- Custom nav walker with different output depending on depth
- Adding html elements to wp nav menu
- Add Thumbnail to wp_list_categories()
- Add class to the items in wp_list_pages
- Customizing Walker_Nav_Menu
- Bar separated navigation by extending Walker_Nav_Menu
- Customize comment list markup
- Where should I use post_class()?
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Bar separated navigation by extending Walker_Page
- Single.php Active Category Class
- Assign different category colours to different categories in the main menu
- Odd/even class on article tag
- Output the aria-labelledby parameter for a nav menu child