Use a very simple custom walker …
class WPSE_82726_Comma_Walker extends Walker
{
public function walk( $elements, $max_depth )
{
$list = array ();
foreach ( $elements as $item )
$list[] = "<a href="https://wordpress.stackexchange.com/questions/82726/$item->url">$item->title</a>";
return join( ', ', $list );
}
}
… and call your menu like this:
wp_nav_menu(
array (
'theme_location' => 'your_registered_theme_location',
'walker' => new WPSE_82726_Comma_Walker,
'items_wrap' => '<p class="menu">%3$s</p>'
)
);
Fast and efficient. 🙂
Related Posts:
- Using a menu walker add a custom item at the end of the menu’s items
- Add settings to menu items in the Customizer
- Show current navigation path from menu
- wordpress nav menu using twitter bootstrap
- What does a walker menu mean?
- Add a logout menu link [duplicate]
- How to open modal window when clicking a WP menu link?
- How to get current page menu item name instead of full menu item list
- change front end menu depending on user login
- Number of items in a menu
- Sub-Pages only of menu items in current branch using a custom menu
- Hide and show menu subpages
- Mobile menu works on local XAMPP, but not on GoDaddy [closed]
- wp_nav_menu and fallback
- list pages only from master parent
- WordPress cache a menu with Transient API
- Counting top level items in a custom menu walker
- How to display the title for each menu item in a span attribute
- Limit top level menu items on wp_nav_menu
- How do you center the main menu in CSS? [closed]
- Wp menu add page link as custom empty link
- How to change the wordpress navigation bar UL to OL in Twenty_Twelve similer theme
- Main Menu and Sub Menu Items for Footer
- how do I add “home” menu item conditionally to custom menus?
- How to add div to top menu item
- wp_nav_menu including Skype URL
- Why is my menu not ordered properly?
- How to add class to and childs of sidebar widget – WordPress
- Hook for number of items in Appearance > Menus > CustomPostType > View All [duplicate]
- add span to top level links of a wordpress menu called “main”
- Unable to center menu and header image twenty twelve [closed]
- Debugging – trying to add search box to menus
- header menu structure: cannot add additional menu items without alignment issues
- My menu bar dissapeared with autooptimize [closed]
- Menu in left side don’t appears with dropdown
- WP custom nav menu problem
- Show WordPress Menu On External Site
- WordPress default menu in database
- If menu has submenu, add parent as first child
- Create custom page and add it in nav menu by code
- Two-tone menu items
- How to highlight 1st level menu item based on actual page
- Admin-ajax.php 500 error when Add to menu is clicked in admin
- replace existing menu programtically
- Submenu items not showing anymore on the navigation
- superfish.js seems it is not working properly after wordpress upgarde to 4.6.1
- How to add an attribute data-slug = “$specfic_page_slug” in WordPress menu item?
- How to add a page to header that is outside of WordPress?
- Get current menu item label for specific parent menu [closed]
- Theme only supports one menu? [closed]
- set certain item in nav walker to active when on archive pages or singles
- Mobile screen does not display Primary navbar…just a three line icon [closed]
- How do I enable “metaboxes” by default in menu editor?
- The cart, checkout, and shop links not getting removed
- New Menu Item Type Meta Box
- Using Different wp_nav_menu theme_location based on page id (or a parent id)
- Display Menu Navigation Label
- Menu is not displaying on the site navigation [closed]
- Creating custom menu with custom themes
- Updated WordPress, now Navigation is Messed Up
- Add posts from a category to menu with all posts in it as sub menu
- wp_nav_menu removing containing UL with ‘items_wrap’ => ‘%3$s’ not working
- How to show only current item children using wp_nav_menu?
- Possible to append class to nav menu added to widget area?
- Page dependent sub-menu?
- Copied site has wrong menu URL behaviour
- Removing wp admin menu item on top bar of admin backend
- Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
- Nav_walker add id to dropdown ul
- Navbar is hidden behind carousel when using wp-boostrap-navwalker
- WordPress nav-menus not finding page
- Primary menu items are dissapearing
- Active Current Menu – Adding class to child theme
- display cart information within li of cart menu item
- WPML CMS Nav and Custom Nav_Walker Undefined Property Notices [closed]
- Add data-track to links in menu
- Is it possible to seperate wordpress menu by different div?
- How to add odd and even classes to all nav links through walker?
- Output sort number in wp menu list item?
- Check in walker if current page is descendant
- Add a non-dynamic phrase/character after a page title?
- how to display wordpress navbar with top menu outside wordpress system
- Active page link not getting class assigned
- Removing menu item doesn’t get removed on edit post
- change link of menu particular tab
- Menus not showing in the admin menu, after save
- Customize Walker_nav_menu to show posts if item is category
- Top menu link anchor href value change after online server?
- Add Protocol to Custom Menus
- How to handle change the appearance of ‘categories’ box on dashboard?
- How can I stop wp_nav_menu from returning extraneous root links?
- How to add posts with thumbnails to my dropdown menu?
- Change menu item order
- Menu System: Custom Links
- Formatting WordPress Menus (without bullets, inline with text)
- Change Menu Order
- Two Homes In Navigation Menu
- Theme supports only one menu. I need to add more – but how? [closed]
- child theme font awesome icons not working
- add dynamic ID for wp_nav_menu after and before