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
- Custom Walker: how to get ID in function start_lvl
- Split up wp_nav_menu with custom walker
- Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu
- Custom menu walker: how can i check first item
- Strict Standards Error bootstrap navwalker
- WordPress Menu Custom Walker Class
- Extend walker class with custom post types [closed]
- Add a different class name to each sticky post?
- Remove and add class with body_class() function
- adding a custom css class to post
- Custom nav walker with different output depending on depth
- Add Thumbnail to wp_list_categories()
- Add class to the items in wp_list_pages
- Customize comment list markup
- Assign different category colours to different categories in the main menu
- Output the aria-labelledby parameter for a nav menu child
- Custom Nav Walker sub-menu HTML construct
- If Loop has odd number of posts on last page Custom style for last post in it
- How to remove trailing tags from wp_nav_menu walker
- Editing or filtering the output of the Genesis navigation
- What does the “$depth” parameter in the Walker_Comment stand for?
- Custom Walker anchor tag not inheriting attributes
- Check what “type” a menu item is
- Adding ‘active’ class to custom taxonomies using walker in functions.php
- How to display dynamic content in start_lvl function
- Create self-populating menu and add extra divs to the menu layout
- List of Body Classes Generated by body_class()
- Add a class to post title if a link ends with a certain extension
- Make wp_list_pages print slugs instead of titles
- Make parent page only link to first subpage
- Add within the output of
- Is this format possible with a custom Nav Walker class?
- WordPress Walker – Group two items?
- How do you add a around the second level of a Menu?
- Dynamic_sidebar inside wp_nav_menu
- Post classes in the loop are being changed in certain themes
- How Do I Add Images To Main Navigation Menu
- New walker for walker_nav_menu to change inside container data
- How to add a element with walker menu right after begin of the navigation tags?
- Using post_class to style posts indivdually
- WordPress Nav Walker – Top menu link with dropdown link not clickable (dropdown opens)
- Add custom class to li element which has children
- Custom menu walker – remove li tag based on class name
- Add a class to post if it has been recently updated
- How to get category names in post_class?
- Check is category parent with ids from the childs – get_term_children
- Walker_Nav_Menu creating too many closing tags?
- wp_dropdown_categories() show elements checkbox
- WordPress change wp_nav_menu walker with a custom one
- WordPress custom menu can’t show 3. level submenu
- Nav Walker that shows only children and siblings of top level parent menu item
- Help with WordPress Custom Nav Walker
- Does the Default theme of WordPress like 2016, 2017 and 2019 uses Walker_Nav_Menu Class
- adding additional class to get the post thumbnail [duplicate]
- How do I use $wp_query->current_post with get_template_part? I’m trying to add post classes (first/last/even/odd) to custom loops
- Where to place a svg chevron down in my custom walker?
- Output existing wp_nav_menu with a custom walker
- how to split vertical menu into two columns using walker nav menu
- How to Display image from Menu Image in Walker Dropdown Select Menu
- Custom menu with Walker class – what should the $db_fields be?
- Count Level 1 Childs for Custom Nav Walker WordPress
- How can I edit submenu headings using wp_nav_menu walker?
- Can’t add optional class to menu item when using Walker_Nav_Menu
- Post Class for Custom Taxonomy Error
- WordPress Tags in class
- Need direction on a seemingly complex menu walker for automatically inserting a parent link li in it’s submenu ul
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- Navigation won’t update to show full path to single post
- Custom navigation / menu output (walker?)
- Using walker to display all menu branches at once?