Working with raw data is always a bit dirty. The clean approach to do that would probably be to implement an own widget, that does exactly what you want it to do.
You can learn more about using the Widget API here: http://codex.wordpress.org/Widgets_API
There are also some great examples there. Not that hard to understand.
To start off, you can basically copypaste the code of the default WP_Nav_Menu_Widget from default-widgets.php
(lines 1298 to 1363) into you theme (I would suggest an own file, which you require from the functions.php
) and start customizing it.
But to come back to Christophs answer: The Walker API is very powerful and learning it is defiantly worth it, if you want to do fancy stuff with navigations, comments, etc. pp.
Related Posts:
- Simple form to add custom links to menu?
- Adding widget to sidebar which contains current page’s submenu
- Add a custom walker to a menu created in a widget
- Limit widget to certain sidebar?
- Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?
- wp_nav_menu remove class and id from li
- Add separator to admin submenu
- Highlight custom widgets in the admin area?
- How to register custom menu widget
- Menu is not visible in appearance
- One site, 2 distinct sections: two different top nav menus?
- Widgets not working in Customizr but working in Appearance
- List children of second level sub page
- Make Theme automatically choose default nav menu
- Get the sidebar ID in which the current widget was dropped
- How can I disable parent menu item links?
- How to exclude certain widget from showing up on home/front page? [duplicate]
- Organizing by super-categories (or nested categories)?
- Override custom menu widget
- Nav menu items disappearing (but not immediately)
- Placing widget to menu
- wp_nav_menu custom walker – child items
- wp_nav_menu doesn’t generate parent/ancestor classes
- Add sidebars to navigation menu?
- Add static item to wp_nav_menu
- register_sidebar ‘after_widget’ on custom-built widgets not implementing, caused nested widgets
- Make compatible custom menu widget for Twitter Bootstrap
- WordPress Custom Menu Widget Style
- Different side menu on each page
- Best practices: Custom theme sidebar menu – hardcode or widget?
- How to get wordpress nav menu outside of wordpress system?
- I need some direction on how to have a sidebar based on meta rather than page
- Add nav menu CSS class to body
- Count widgets of a certain type
- Vertical Sidebar Menu Parent and Child not displaying correctly [closed]
- Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?
- Custom Admin Menu Order
- Current menu item
- remove everything from wp_nav_menu
- How to give custom classes to the WordPress Menu widget
- How to add #navbar to all page links?
- How to add wechat (weixin) link to navigation menu?
- Admin only menu/page
- Sidebar links for different pages
- Best way to customise wp_nav_menu [duplicate]
- Prev / Next menu item
- How to add custom classes to more than one separate menu’s a link in wordpress?
- How do I separate link levels in a custom menu walker?
- SlideDeck 2, make back-end visible for admins only
- display menus on all page except one?
- Best practices regarding the creation of custom widgets?
- How to handle many different menus?
- Choose sidebars column in widgets.php page [closed]
- How to show dynamic side bar on menu item [closed]
- Displaying different page links on different pages
- pull non-wp site into content area of wordpress -or- pull wp header into non wp site?
- Help with walker for nav
- Using my WordPress menu on another platform
- Dynamic_sidebar inside wp_nav_menu
- Remove a menu sub-item
- How to add html attributes to the “ul” html tag with “wp_nav_menu” function?
- Using _s theme, menu changes do not affect header menu
- Limit User Iinterface for Admin?
- Best practice for including plugin output in a template without using shortcode?
- Submenu in sidebar custom page template
- Add a specific css to a widget
- Recent Posts widget missing current_menu_item class
- Stop Expansion of Top Level Menu in the WordPress Admin Sidebar
- How to undo the last changes to a custom menu?
- Filter to hook into menu items and add a custom attribute
- I can’t add more pages to menu – menu delete pages
- New checkbox in custom widget isn’t saving data
- Responsive menu on genesis theme [closed]
- How to avoid the and which added when custon menu widget is used
- “Widgets” menu doesn’t appear
- Remove/Hide a Widget on a Custom Template
- How to open a lightbox form from a navigation menu item
- How to create this kind of sub-menu in new line?
- How to add social buttons like facebook and twitter in the footer of a theme?
- Catagorized hierarchy menu for PAGES!
- Hide custom menu when when no menu selected
- How to create menu spread over four lines including images
- Customize Widget Navigation
- Is there any difference between widgets (used in order to manage menus) and register_nav_menus() in terms of performance?
- How to point menu to my homepage
- How to narrow the area between buttons on Helium theme sidebar? [closed]
- Add a data attribute to list item element in menu
- Add Class to Custom Menu Widget ul
- How to list categories by page id in wordpress
- How to add a toggle on the left side of my page?
- Best strategy for providing theme options using customizer
- Any reason why widgets/menus get emptied when I updated custom theme code?
- Creating and populating custom nav menu (menu-item-position not working)
- custom rearranged menu with excerpt for selected children in sidebar.php
- wp_nav_menu in 3.7 add name class nav navbar-nav
- Menu – custom structure
- Custom tabs widget don’t work in google chrome, is blocked, do not change the tabs. Why?
- custom walker to add iconfont to wp_nav_menu
- How do I include the sidebar (with Widgets) in a custom theme?
- Hiding Widget On Mobile Devices Removes Our Product Search Box On Mobiles