The Walker class was implemented in WordPress 2.1 to provide developers with a means to traverse tree-like data structures for the purpose of rendering HTML.

learn more… | top users | synonyms

0
votes
1answer
96 views

Customize Walker_nav_menu to show posts if item is category

I would like to customize the nav menu walker so that when it encounters a category it automatically makes the 5 most resent posts children of the menu item. Is there a way to dynamically add items ...
1
vote
0answers
39 views

Can I use multiple nav_walkers?

I am working on a project and I came to the conclusion that I need to use 3 nav walkers: one for edit and 2 for HTML formatting class MY_Walker_Nav_Menu_Edit extends Walker_Nav_Menu {} // this ...
0
votes
1answer
117 views

How to add a element with walker menu right after begin of the navigation tags?

I was trying to add a element right after begin of the navigation tags and before the ul will start. So add a element directly after opening nav tag. I tried this, but this will add a list item after ...
-1
votes
1answer
33 views

Custom walker pulldown display current page

I have this pulldown menu and when I go to a page with this pulldown menu, I want that the current page is showed in the pulldown menu. I've searched in the documentation but can't find any. class ...
0
votes
1answer
84 views

Add login hyperlink to secondary navigation menu

I have the following lines of code in my functions.php file: #-----------------------------------------------------------------# # Custom menu ...
0
votes
0answers
15 views

Get parent menu item id on submenu ul using start_lvl [duplicate]

I'm struggling with the Walker_Nav_Menu. In the start_lvl function, where I create the <ul> tag holding my submenu, I want to insert the item ID from the parent menu item. I know that I can ...
1
vote
0answers
133 views

Split into two seperate unordered lists with custom walker

So I am trying to create a mega-menu using a custom walker through Wordpress. So far I have this for the walker: class oe_walker extends Walker_Nav_Menu { /** * Specify the item type to ...
0
votes
0answers
185 views

Adding 3rd level in custom walker

at present my custom walker works great :) but I can for the life of me get a 3rd level to appear... I can get the top level and the 2nd level dropdown to show perfect, but how do I achieve a 3rd ...
0
votes
0answers
142 views

Need a conditional div in custom Walker function for wp_nav_menu()

I have used wp_nav_menu() for my custom WP sites with Custom Walker Function which is working fine and providing me below output: <div id="navbar" class="navbar-collapse"> <ul ...
0
votes
0answers
307 views

How to add class to parent a tag with a sub menu

I have been trying to add a class to the parent a tag of a sub menu using a custom walker. The current walker I am using adds the class to the parent <li>, does anybody know how to adjust this ...
0
votes
0answers
214 views

Custom Walker function need to customize in a specific way for wp_nav_menu in Wordpress

I have used wp_nav_menu() for my custom WP sites with Custom Walker Function which is working fine and providing me below output: <div id="navbar" class="navbar-collapse"> <ul ...
4
votes
4answers
515 views

Any walker causes blank menu?

Using the following, or any other custom Walker_Nav_Menu seems to cause a blank navigation menu, I tried specifying the default to make sure I wasn't going crazy yet it still blanks the output... Any ...
0
votes
0answers
71 views

Customizing Walker_Nav_Menu - Trunicating spaces

I've just started learning to code WP themes pretty much from scratch and I'm trying to figure out how to pass a variable thru a customized Walker_Nav_Menu but without any ascii spaces. The goal is ...
0
votes
0answers
95 views

Wordpress menu walker - get the parent item

I want to implement a menu walker system where only those submenu items get listed which have a specific parent. So let's say I have two level one menu items, A and B. On a page I want to get listed ...
1
vote
1answer
85 views

Use menu class in walker function

Is there anyway, using the custom menu css classes that are turned on in the option, to apply those via a walker function to the span instead of the li's? My custom walker: class ik_walker extends ...
1
vote
1answer
301 views

Custom walker nav - Add sequential number as class

I'm getting to grips with the walker at the moment, but i need some assistance in getting my desired effect. My walker function looks like: class ik_walker extends Walker_Nav_Menu{ //start of ...
0
votes
0answers
22 views

Walker customization - submenu & HTML description

I'm working on a site created by another person who used this customization to display a HTML description (img) in the menu. Now, I'd like for only a menu item to display the subpages, but I can. ...
0
votes
0answers
133 views

creating a custom walker class

I am currently developing a theme for wordpress, and would like to add some data values to the list items that are returned. Here is the basic structure of my nav: <div id="nav" class="grid_9 ...
0
votes
1answer
329 views

Editing or filtering the output of the Genesis navigation

I'm trying to edit or apply a filter to the default Genesis navigation genesis_do_nav Currently I'm extending a Walker class to add a <span> with data-attribute around the navigation's link ...
0
votes
0answers
45 views

walker class for custom menu structure

i design a html template for hospital website and my menu structure is like this: <div class="innerW"> <ul class="clearfix"> <li class="tN nav1"> <a ...
1
vote
1answer
214 views

Walker nav remove submenu ul from a certain depth

I want to remove sub-menu ul and .menu-item-has-children class when the menu depth is superior or egal to 2. So, I only want a menu with 3 sub-menu at maximum. Other item children will still ...
1
vote
1answer
128 views

Removing <li> from Comment

I'm making a custom comment template, and I do not wish to use a list to display comments. By default, WordPress puts the following at the end of every comment: </li><!-- #comment-## --> ...
0
votes
0answers
137 views

Image URL only for custom navigation walker (walker_nav_menu)

I'm attempting to build a custom navigation walker that pulls a page's Featured Image into the page's menu item. I intend to use the Featured Image as a background for the menu item (which is prettier ...
0
votes
0answers
68 views

Transform <ul> menu in <table> menu

Someone can help me? I'm trying to create a walker's menu but I think is impossible. I want to create a top level menu as a table, but with 2 rows. For example, a typical one option menu will be: ...
0
votes
1answer
105 views

wp_list_pages hierarchical help

So I have been searching online for something that I think is simple to achieve and I am most likely over thinking it. I have found many related articles on the matter but can't seem to get it to ...
0
votes
1answer
20 views

Need direction on a seemingly complex menu walker for automatically inserting a parent link li in it's submenu ul

I'd appreciate some direction on how to accomplish something with my WordPress menu. I've Googled this for hours without avail. I was to automatically insert a parent link into it's immediate submenu ...
0
votes
0answers
47 views

How to display menu description, but only if there is a sub menu?

Today I've written my own custom menu walker. While I am a bit shocked how difficult this is (also because there seem to be some bugs in Wordpress), I am astonished that I could make everything work. ...
0
votes
0answers
131 views

sub menu in bootstrap is not displaying

this is my custom walker function. class Bootstrap_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth = 0, $args = array()) { $output .= "\n<ul ...
1
vote
2answers
825 views

How to remove trailing </li> tags from wp_nav_menu walker

I have used theme twenty thirteen a my base theme and Have tried used code from http://stackoverflow.com/questions/12159486/wordpress-change-header-navigation-list-items-to-div when I try to validate ...
0
votes
1answer
77 views

Using Different nav_menu_css_class for different nav_walkers

On my theme I have to different nav_walkers, I'd like to be able to call two different nav_menu_css_class-es for each menu alas, they appear to apply globally. Here's what I have function ...
1
vote
0answers
123 views

Walker Class - Check if menu item has description and if so add class to li

I am using a pretty common walker class to pull in the description when I call the wp_nav_menu function. I am using this to add an optional second line for the menu, using the description. This of ...
2
votes
1answer
2k views

Show top-level parent with submenu menu walker

I've used the menu walker below to display dynamic submenus with great effect in the past. It displays 2nd- or lower-level menu items IF the current page is a parent, sibling, or descendant of the ...
1
vote
1answer
3k views

Customizing Walker_Nav_Menu

I'm looking for a solution to adjust the output of wp_nav_menu only on a specific navigation menu. I have my menu: wp_nav_menu( array( "container" => "nav", ...
0
votes
1answer
1k views

Adding ul class with wp_list_categories Custom Walker

I am trying to achieve something that seems like it should be simple but is causing me headaches. I am listing my categories out using wp_list_categories which gives me this... <ul> ...
2
votes
0answers
407 views

Custom menu walker: how can i check first item

I need to output different html code only for the first item of my submenus. How can I check in start_el() function if current item is first or not? Example: Menu voice 1 -- Sub 1 -- Sub 2 -- Sub 3 ...
0
votes
2answers
2k views

Show children (sub-navigation) of active menu item only

So I've searched the net and attempted to code a custom walker class that will do this, but I'm new to WordPress and although similar questions exist none fit exactly what I'm looking for, or suggest ...
3
votes
2answers
140 views

How does a minimal menu walker look like?

According to the docs of wp_nav_menu we can specify our own walker function. They suggest to copy the default one and modify it as needed. But to be honest, it is a bit too complicated for the to ...
0
votes
0answers
195 views

Additional class for.sub-menu UL?

This code returns my WordPress menu: <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'header-menu') ); ?> What's the easiest (non-JS) way of adding additional ...
2
votes
3answers
2k views

Strict Standards Error bootstrap navwalker

I am having trouble understanding this error and I've not come across it before, please could someone help? Strict Standards: Declaration of wp_bootstrap_navwalker::start_lvl() should be compatible ...
-1
votes
1answer
164 views

Custom navigation / menu output (walker?)

I'm trying to implement a responsive jQuery navigation but I need to extend the default output of the WP menu. I believe I need to use a custom walker but honestly, I don't know how to get it to work ...
0
votes
1answer
707 views

Single.php Active Category Class

Currently by default (I believe) when you're on single.php, Wordpress doesn't add a "Active" class to the blog category you're viewing the single post in like it would for pages or if you're on the ...
0
votes
0answers
44 views

How can I modify wp_nav_menu with walker?

I would like my wp_nav_menu to output in the format for jquery ui: <h3>Section 1</h3> <div> <p> Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut ...
0
votes
0answers
23 views

Help with Wordpress Walker Function [duplicate]

I need some help customizing a walker function. I don't fully undrestand it, but it's helped me get half of what I need. class themeslug_walker_nav_menu extends Walker_Nav_Menu { // add ...
0
votes
1answer
962 views

Customizing a walker menu class

Hey Folks I trying to customize a walker class to add custom classes to navigation level. Essentially there will be 3 levels of navigation. <ul *custom class*> <li *custom class*> ...
0
votes
1answer
55 views

Modifying navigation menu classes with a Walker

I did a class that extends Walker_Nav_Menu to modify the default classes of my < li >s but also to modify the default classes of my < ul >s. It seems that only the sub-menus are affected by the ...
0
votes
1answer
107 views

Walker for menus

I want to modify all of my <li>'s classes and ids, but the function wp_nav_menu() does not let me do so, so I think I need to use a walker. I am pretty new in OO, so using an object is not ...
0
votes
1answer
92 views

custom walker class for own menu?

i have designed a html template for own blog, in my theme my menu is this structure, <ul class="right"> <li class="has-dropdown"> <a class="active" href="index.html">Home</a> ...
1
vote
0answers
91 views

Customizing Primary Menu to include custom taxonomy description

I've a hard time implementing the custom primary menu behaviour. I've already: Created a custom post type: products that has a custom taxonomy: product_category associated with it. Activated and ...
0
votes
1answer
768 views

Use wp_nav_menu to dynamically generate child menus

The goal: use wordpress's wp_nav_menu to generate a menu where child pages were dynamically added while keeping the correct submenu classes. Before: Installations Habits After: Installations ...
0
votes
1answer
111 views

How do I separate link levels in a custom menu walker?

I am trying to build a custom menu walker and I am unclear on how I would be able to build a UL for top level menu items and a separate UL for all menu items of lower levels. Essentially I am trying ...